diff --git a/sdk/containerservice/azure-mgmt-containerservice/_meta.json b/sdk/containerservice/azure-mgmt-containerservice/_meta.json index 265ab7ba2f50..5e452c8b34b1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/_meta.json +++ b/sdk/containerservice/azure-mgmt-containerservice/_meta.json @@ -1,11 +1,89 @@ { - "commit": "07f6af5ba991088995d774e80e3d94b364611baf", + "commit": "e4476b4ebb34733a561a0ff227e8625723827725", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.7", + "autorest": "3.10.2", "use": [ - "@autorest/python@6.13.7", + "@autorest/python@6.13.16", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False", - "readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md" + "autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.13.16 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md", + "package-preview-2024-04": "2024-05-30 05:38:04 +0000 80fa3f0d795c36824dcfcf654f514a0504ae7d98 preview/2024-04-02-preview/managedClusters.json", + "package-preview-2024-03": "2024-04-30 07:30:14 +0800 41751f4f6c36a0ae8c3db08d3c1e16d213a25bb8 preview/2024-03-02-preview/managedClusters.json", + "package-2024-02": "2024-03-25 11:19:05 +0800 c9216e204f4e4c7a61af263f387ddad028a173aa stable/2024-02-01/managedClusters.json", + "package-preview-2024-02": "2024-03-27 16:39:21 +0800 8429152fd329f40b2b77e51d6c74921dd12af122 preview/2024-02-02-preview/managedClusters.json", + "package-2024-01": "2024-02-19 13:08:53 +0800 477b483e1b6d4f343432c238c417a1ab47de858b stable/2024-01-01/managedClusters.json", + "package-preview-2024-01": "2024-02-20 14:49:34 +0800 14d36fdc83698d3cee71cc4448b4316a9d4d736e preview/2024-01-02-preview/managedClusters.json", + "package-2023-11": "2024-01-18 03:51:18 +0800 ebf29a8107ea2d7f65c2d74bf9196ec672ed18c2 stable/2023-11-01/managedClusters.json", + "package-preview-2023-11": "2024-02-02 00:15:59 +0800 eca452ea5bedf668299276087531e98558540e3c preview/2023-11-02-preview/managedClusters.json", + "package-2023-10": "2023-11-08 02:41:38 +0800 dc44fb5cf9b20b678e7e5c5bc90af1622ca6008b stable/2023-10-01/managedClusters.json", + "package-preview-2023-10": "2023-11-15 06:05:35 +0800 8cd51b5240f4773621ec74346b6f5fb13f2c0e83 preview/2023-10-02-preview/managedClusters.json", + "package-2023-09": "2023-10-20 10:06:44 +0800 8c49a56458eeb093c0a6dee16e9b71ccdda0a888 stable/2023-09-01/managedClusters.json", + "package-preview-2023-09": "2023-10-25 17:47:27 +0800 a032c2413b49d297196a0c64393e862433fccbb1 preview/2023-09-02-preview/managedClusters.json", + "package-2023-08": "2023-09-20 21:02:12 +0800 1e0097098ee58c7c9b9bbd952bcc309244707654 stable/2023-08-01/managedClusters.json", + "package-preview-2023-08": "2023-09-29 00:37:40 +0800 657bda014dd85860f8d5eb3fefd00e6888a9259b preview/2023-08-02-preview/managedClusters.json", + "package-2023-07": "2023-08-08 09:49:45 +0800 7848c0430929469eb9a6a827777d822faff7dc65 stable/2023-07-01/managedClusters.json", + "package-preview-2023-07": "2023-09-12 12:00:43 -0700 250a8bb16297fcffd5fb07e41ba84eb5a549324a preview/2023-07-02-preview/managedClusters.json", + "package-2023-06": "2023-07-21 03:39:44 +0800 e413760a8ba680c5d71dea6a47ce021af5dab6e2 stable/2023-06-01/managedClusters.json", + "package-preview-2023-06": "2023-09-12 12:00:43 -0700 250a8bb16297fcffd5fb07e41ba84eb5a549324a preview/2023-06-02-preview/managedClusters.json", + "package-2023-05": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 stable/2023-05-01/managedClusters.json", + "package-preview-2023-05": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 preview/2023-05-02-preview/managedClusters.json", + "package-2023-04": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 stable/2023-04-01/managedClusters.json", + "package-preview-2023-04": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 preview/2023-04-02-preview/managedClusters.json", + "package-2023-03": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 stable/2023-03-01/managedClusters.json", + "package-preview-2023-03": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 preview/2023-03-02-preview/managedClusters.json", + "package-2023-02": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 stable/2023-02-01/managedClusters.json", + "package-preview-2023-02": "2023-06-28 14:33:18 +1200 e7db720b9842d971cd008d16b7cdb579e7b802f2 preview/2023-02-02-preview/managedClusters.json", + "package-2023-01": "2023-03-22 10:58:20 +0800 9c9786a53eb85f49b77f274fb5baf666ef9f6a30 stable/2023-01-01/managedClusters.json", + "package-preview-2023-01-only": "2023-03-22 10:58:20 +0800 9c9786a53eb85f49b77f274fb5baf666ef9f6a30 preview/2023-01-02-preview/managedClusters.json", + "package-2022-11": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2022-11-01/managedClusters.json", + "package-preview-2022-11-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-11-02-preview/managedClusters.json", + "package-preview-2022-10-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-10-02-preview/managedClusters.json", + "package-2022-09": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2022-09-01/managedClusters.json", + "package-preview-2022-09": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-09-02-preview/managedClusters.json", + "package-preview-2022-08-03-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-08-03-preview/managedClusters.json", + "package-preview-2022-08-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-08-02-preview/managedClusters.json", + "package-2022-07": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2022-07-01/managedClusters.json", + "package-preview-2022-07": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-07-02-preview/managedClusters.json", + "package-2022-06": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2022-06-01/managedClusters.json", + "package-preview-2022-06": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-06-02-preview/managedClusters.json", + "package-preview-2022-05": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-05-02-preview/managedClusters.json", + "package-2022-04": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2022-04-01/managedClusters.json", + "package-preview-2022-04": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-04-02-preview/managedClusters.json", + "package-2022-03": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2022-03-01/managedClusters.json", + "package-preview-2022-03": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-03-02-preview/managedClusters.json", + "package-2022-02": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2022-02-01/managedClusters.json", + "package-preview-2022-02": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-02-02-preview/managedClusters.json", + "package-2022-01": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2022-01-01/managedClusters.json", + "package-preview-2022-01": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-01-02-preview/managedClusters.json", + "package-preview-2021-11": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2021-11-01-preview/managedClusters.json", + "package-2021-10": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2021-10-01/managedClusters.json", + "package-2021-09": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2021-09-01/managedClusters.json", + "package-2021-08": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2021-08-01/managedClusters.json", + "package-2021-07": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2021-07-01/managedClusters.json", + "package-2021-05": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2021-05-01/managedClusters.json", + "package-2021-03": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2021-03-01/managedClusters.json", + "package-2021-02": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2021-02-01/managedClusters.json", + "package-2020-12": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-12-01/managedClusters.json", + "package-2020-11": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-11-01/managedClusters.json", + "package-2020-09-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-09-01/managedClusters.json", + "package-2020-07-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-07-01/managedClusters.json", + "package-2020-06-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-06-01/managedClusters.json", + "package-2020-04-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-04-01/managedClusters.json", + "package-2020-03-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-03-01/managedClusters.json", + "package-2020-02-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-02-01/managedClusters.json", + "package-2020-01-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2020-01-01/managedClusters.json", + "package-2019-11-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2019-11-01/managedClusters.json", + "package-2019-10-27-preview-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2019-10-27-preview/openShiftManagedClusters.json", + "package-2019-10-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2019-10-01/managedClusters.json", + "package-2019-08-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2019-08-01/managedClusters.json", + "package-2019-06-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2019-06-01/managedClusters.json", + "package-2019-04-30-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2019-04-30/openShiftManagedClusters.json", + "package-2019-04-01-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2019-04-01/managedClusters.json", + "package-2019-02-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2019-02-01/managedClusters.json", + "package-2018-09-preview-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2018-09-30-preview/openShiftManagedClusters.json", + "package-2018-08-preview-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2018-08-01-preview/managedClusters.json", + "package-2018-03-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2018-03-31/managedClusters.json", + "package-2019-09-preview-only": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2019-09-30/openShiftManagedClusters.json", + "package-2017-07": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 stable/2017-07-01/containerService.json" } \ No newline at end of file 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 60d76fe7b7d5..56b08d49d797 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 @@ -63,10 +63,7 @@ class ContainerServiceClient(MultiApiClientMixin, _SDKClient): 'container_services': '2019-04-01', 'fleet_members': '2022-09-02-preview', 'fleets': '2022-09-02-preview', - 'machines': '2024-01-02-preview', - 'managed_cluster_snapshots': '2024-01-02-preview', 'open_shift_managed_clusters': '2019-04-30', - 'operation_status_result': '2024-01-02-preview', }}, _PROFILE_TAG + " latest" ) @@ -190,6 +187,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2024-01-01: :mod:`v2024_01_01.models` * 2024-01-02-preview: :mod:`v2024_01_02_preview.models` * 2024-02-01: :mod:`v2024_02_01.models` + * 2024-02-02-preview: :mod:`v2024_02_02_preview.models` + * 2024-03-02-preview: :mod:`v2024_03_02_preview.models` + * 2024-04-02-preview: :mod:`v2024_04_02_preview.models` """ if api_version == '2017-07-01': from .v2017_07_01 import models @@ -416,6 +416,15 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2024-02-01': from .v2024_02_01 import models return models + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview import models + return models + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview import models + return models + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -490,6 +499,9 @@ def agent_pools(self): * 2024-01-01: :class:`AgentPoolsOperations` * 2024-01-02-preview: :class:`AgentPoolsOperations` * 2024-02-01: :class:`AgentPoolsOperations` + * 2024-02-02-preview: :class:`AgentPoolsOperations` + * 2024-03-02-preview: :class:`AgentPoolsOperations` + * 2024-04-02-preview: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -628,6 +640,12 @@ def agent_pools(self): from .v2024_01_02_preview.operations import AgentPoolsOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import AgentPoolsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import AgentPoolsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import AgentPoolsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -690,6 +708,23 @@ def fleets(self): 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 load_balancers(self): + """Instance depends on the API version: + + * 2024-03-02-preview: :class:`LoadBalancersOperations` + * 2024-04-02-preview: :class:`LoadBalancersOperations` + """ + api_version = self._get_api_version('load_balancers') + if api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import LoadBalancersOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_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 + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property def machines(self): """Instance depends on the API version: @@ -700,6 +735,9 @@ def machines(self): * 2023-10-02-preview: :class:`MachinesOperations` * 2023-11-02-preview: :class:`MachinesOperations` * 2024-01-02-preview: :class:`MachinesOperations` + * 2024-02-02-preview: :class:`MachinesOperations` + * 2024-03-02-preview: :class:`MachinesOperations` + * 2024-04-02-preview: :class:`MachinesOperations` """ api_version = self._get_api_version('machines') if api_version == '2023-07-02-preview': @@ -714,6 +752,12 @@ def machines(self): from .v2023_11_02_preview.operations import MachinesOperations as OperationClass elif api_version == '2024-01-02-preview': from .v2024_01_02_preview.operations import MachinesOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import MachinesOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import MachinesOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -777,6 +821,9 @@ def maintenance_configurations(self): * 2024-01-01: :class:`MaintenanceConfigurationsOperations` * 2024-01-02-preview: :class:`MaintenanceConfigurationsOperations` * 2024-02-01: :class:`MaintenanceConfigurationsOperations` + * 2024-02-02-preview: :class:`MaintenanceConfigurationsOperations` + * 2024-03-02-preview: :class:`MaintenanceConfigurationsOperations` + * 2024-04-02-preview: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -887,6 +934,12 @@ def maintenance_configurations(self): from .v2024_01_02_preview.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -919,6 +972,9 @@ def managed_cluster_snapshots(self): * 2023-10-02-preview: :class:`ManagedClusterSnapshotsOperations` * 2023-11-02-preview: :class:`ManagedClusterSnapshotsOperations` * 2024-01-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2024-02-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2024-03-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2024-04-02-preview: :class:`ManagedClusterSnapshotsOperations` """ api_version = self._get_api_version('managed_cluster_snapshots') if api_version == '2022-02-02-preview': @@ -967,6 +1023,12 @@ def managed_cluster_snapshots(self): from .v2023_11_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass elif api_version == '2024-01-02-preview': from .v2024_01_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_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 @@ -1046,6 +1108,9 @@ def managed_clusters(self): * 2024-01-01: :class:`ManagedClustersOperations` * 2024-01-02-preview: :class:`ManagedClustersOperations` * 2024-02-01: :class:`ManagedClustersOperations` + * 2024-02-02-preview: :class:`ManagedClustersOperations` + * 2024-03-02-preview: :class:`ManagedClustersOperations` + * 2024-04-02-preview: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -1188,6 +1253,12 @@ def managed_clusters(self): from .v2024_01_02_preview.operations import ManagedClustersOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import ManagedClustersOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import ManagedClustersOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import ManagedClustersOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -1223,6 +1294,9 @@ def operation_status_result(self): * 2023-10-02-preview: :class:`OperationStatusResultOperations` * 2023-11-02-preview: :class:`OperationStatusResultOperations` * 2024-01-02-preview: :class:`OperationStatusResultOperations` + * 2024-02-02-preview: :class:`OperationStatusResultOperations` + * 2024-03-02-preview: :class:`OperationStatusResultOperations` + * 2024-04-02-preview: :class:`OperationStatusResultOperations` """ api_version = self._get_api_version('operation_status_result') if api_version == '2023-10-02-preview': @@ -1231,6 +1305,12 @@ def operation_status_result(self): from .v2023_11_02_preview.operations import OperationStatusResultOperations as OperationClass elif api_version == '2024-01-02-preview': from .v2024_01_02_preview.operations import OperationStatusResultOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import OperationStatusResultOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import OperationStatusResultOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_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 @@ -1310,6 +1390,9 @@ def operations(self): * 2024-01-01: :class:`Operations` * 2024-01-02-preview: :class:`Operations` * 2024-02-01: :class:`Operations` + * 2024-02-02-preview: :class:`Operations` + * 2024-03-02-preview: :class:`Operations` + * 2024-04-02-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -1452,6 +1535,12 @@ def operations(self): from .v2024_01_02_preview.operations import Operations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import Operations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import Operations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import Operations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -1519,6 +1608,9 @@ def private_endpoint_connections(self): * 2024-01-01: :class:`PrivateEndpointConnectionsOperations` * 2024-01-02-preview: :class:`PrivateEndpointConnectionsOperations` * 2024-02-01: :class:`PrivateEndpointConnectionsOperations` + * 2024-02-02-preview: :class:`PrivateEndpointConnectionsOperations` + * 2024-03-02-preview: :class:`PrivateEndpointConnectionsOperations` + * 2024-04-02-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -1637,6 +1729,12 @@ def private_endpoint_connections(self): from .v2024_01_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -1702,6 +1800,9 @@ def private_link_resources(self): * 2024-01-01: :class:`PrivateLinkResourcesOperations` * 2024-01-02-preview: :class:`PrivateLinkResourcesOperations` * 2024-02-01: :class:`PrivateLinkResourcesOperations` + * 2024-02-02-preview: :class:`PrivateLinkResourcesOperations` + * 2024-03-02-preview: :class:`PrivateLinkResourcesOperations` + * 2024-04-02-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -1816,6 +1917,12 @@ def private_link_resources(self): from .v2024_01_02_preview.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -1881,6 +1988,9 @@ def resolve_private_link_service_id(self): * 2024-01-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2024-01-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` * 2024-02-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2024-02-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` + * 2024-03-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` + * 2024-04-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -1995,6 +2105,12 @@ def resolve_private_link_service_id(self): from .v2024_01_02_preview.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -2053,6 +2169,9 @@ def snapshots(self): * 2024-01-01: :class:`SnapshotsOperations` * 2024-01-02-preview: :class:`SnapshotsOperations` * 2024-02-01: :class:`SnapshotsOperations` + * 2024-02-02-preview: :class:`SnapshotsOperations` + * 2024-03-02-preview: :class:`SnapshotsOperations` + * 2024-04-02-preview: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2021-08-01': @@ -2153,6 +2272,12 @@ def snapshots(self): from .v2024_01_02_preview.operations import SnapshotsOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import SnapshotsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import SnapshotsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import SnapshotsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -2188,6 +2313,9 @@ def trusted_access_role_bindings(self): * 2024-01-01: :class:`TrustedAccessRoleBindingsOperations` * 2024-01-02-preview: :class:`TrustedAccessRoleBindingsOperations` * 2024-02-01: :class:`TrustedAccessRoleBindingsOperations` + * 2024-02-02-preview: :class:`TrustedAccessRoleBindingsOperations` + * 2024-03-02-preview: :class:`TrustedAccessRoleBindingsOperations` + * 2024-04-02-preview: :class:`TrustedAccessRoleBindingsOperations` """ api_version = self._get_api_version('trusted_access_role_bindings') if api_version == '2022-04-02-preview': @@ -2242,6 +2370,12 @@ def trusted_access_role_bindings(self): from .v2024_01_02_preview.operations import TrustedAccessRoleBindingsOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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 @@ -2277,6 +2411,9 @@ def trusted_access_roles(self): * 2024-01-01: :class:`TrustedAccessRolesOperations` * 2024-01-02-preview: :class:`TrustedAccessRolesOperations` * 2024-02-01: :class:`TrustedAccessRolesOperations` + * 2024-02-02-preview: :class:`TrustedAccessRolesOperations` + * 2024-03-02-preview: :class:`TrustedAccessRolesOperations` + * 2024-04-02-preview: :class:`TrustedAccessRolesOperations` """ api_version = self._get_api_version('trusted_access_roles') if api_version == '2022-04-02-preview': @@ -2331,6 +2468,12 @@ def trusted_access_roles(self): from .v2024_01_02_preview.operations import TrustedAccessRolesOperations as OperationClass elif api_version == '2024-02-01': from .v2024_02_01.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2024-02-02-preview': + from .v2024_02_02_preview.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2024-03-02-preview': + from .v2024_03_02_preview.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2024-04-02-preview': + from .v2024_04_02_preview.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/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py index c341fd012c37..0d6518511b3a 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 @@ -63,10 +63,7 @@ class ContainerServiceClient(MultiApiClientMixin, _SDKClient): 'container_services': '2019-04-01', 'fleet_members': '2022-09-02-preview', 'fleets': '2022-09-02-preview', - 'machines': '2024-01-02-preview', - 'managed_cluster_snapshots': '2024-01-02-preview', 'open_shift_managed_clusters': '2019-04-30', - 'operation_status_result': '2024-01-02-preview', }}, _PROFILE_TAG + " latest" ) @@ -190,6 +187,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2024-01-01: :mod:`v2024_01_01.models` * 2024-01-02-preview: :mod:`v2024_01_02_preview.models` * 2024-02-01: :mod:`v2024_02_01.models` + * 2024-02-02-preview: :mod:`v2024_02_02_preview.models` + * 2024-03-02-preview: :mod:`v2024_03_02_preview.models` + * 2024-04-02-preview: :mod:`v2024_04_02_preview.models` """ if api_version == '2017-07-01': from ..v2017_07_01 import models @@ -416,6 +416,15 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2024-02-01': from ..v2024_02_01 import models return models + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview import models + return models + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview import models + return models + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -490,6 +499,9 @@ def agent_pools(self): * 2024-01-01: :class:`AgentPoolsOperations` * 2024-01-02-preview: :class:`AgentPoolsOperations` * 2024-02-01: :class:`AgentPoolsOperations` + * 2024-02-02-preview: :class:`AgentPoolsOperations` + * 2024-03-02-preview: :class:`AgentPoolsOperations` + * 2024-04-02-preview: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -628,6 +640,12 @@ def agent_pools(self): from ..v2024_01_02_preview.aio.operations import AgentPoolsOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -690,6 +708,23 @@ def fleets(self): 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 load_balancers(self): + """Instance depends on the API version: + + * 2024-03-02-preview: :class:`LoadBalancersOperations` + * 2024-04-02-preview: :class:`LoadBalancersOperations` + """ + api_version = self._get_api_version('load_balancers') + if api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import LoadBalancersOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_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 + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)), api_version) + @property def machines(self): """Instance depends on the API version: @@ -700,6 +735,9 @@ def machines(self): * 2023-10-02-preview: :class:`MachinesOperations` * 2023-11-02-preview: :class:`MachinesOperations` * 2024-01-02-preview: :class:`MachinesOperations` + * 2024-02-02-preview: :class:`MachinesOperations` + * 2024-03-02-preview: :class:`MachinesOperations` + * 2024-04-02-preview: :class:`MachinesOperations` """ api_version = self._get_api_version('machines') if api_version == '2023-07-02-preview': @@ -714,6 +752,12 @@ def machines(self): from ..v2023_11_02_preview.aio.operations import MachinesOperations as OperationClass elif api_version == '2024-01-02-preview': from ..v2024_01_02_preview.aio.operations import MachinesOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import MachinesOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import MachinesOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -777,6 +821,9 @@ def maintenance_configurations(self): * 2024-01-01: :class:`MaintenanceConfigurationsOperations` * 2024-01-02-preview: :class:`MaintenanceConfigurationsOperations` * 2024-02-01: :class:`MaintenanceConfigurationsOperations` + * 2024-02-02-preview: :class:`MaintenanceConfigurationsOperations` + * 2024-03-02-preview: :class:`MaintenanceConfigurationsOperations` + * 2024-04-02-preview: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -887,6 +934,12 @@ def maintenance_configurations(self): from ..v2024_01_02_preview.aio.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -919,6 +972,9 @@ def managed_cluster_snapshots(self): * 2023-10-02-preview: :class:`ManagedClusterSnapshotsOperations` * 2023-11-02-preview: :class:`ManagedClusterSnapshotsOperations` * 2024-01-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2024-02-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2024-03-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2024-04-02-preview: :class:`ManagedClusterSnapshotsOperations` """ api_version = self._get_api_version('managed_cluster_snapshots') if api_version == '2022-02-02-preview': @@ -967,6 +1023,12 @@ def managed_cluster_snapshots(self): from ..v2023_11_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass elif api_version == '2024-01-02-preview': from ..v2024_01_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_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 @@ -1046,6 +1108,9 @@ def managed_clusters(self): * 2024-01-01: :class:`ManagedClustersOperations` * 2024-01-02-preview: :class:`ManagedClustersOperations` * 2024-02-01: :class:`ManagedClustersOperations` + * 2024-02-02-preview: :class:`ManagedClustersOperations` + * 2024-03-02-preview: :class:`ManagedClustersOperations` + * 2024-04-02-preview: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -1188,6 +1253,12 @@ def managed_clusters(self): from ..v2024_01_02_preview.aio.operations import ManagedClustersOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -1223,6 +1294,9 @@ def operation_status_result(self): * 2023-10-02-preview: :class:`OperationStatusResultOperations` * 2023-11-02-preview: :class:`OperationStatusResultOperations` * 2024-01-02-preview: :class:`OperationStatusResultOperations` + * 2024-02-02-preview: :class:`OperationStatusResultOperations` + * 2024-03-02-preview: :class:`OperationStatusResultOperations` + * 2024-04-02-preview: :class:`OperationStatusResultOperations` """ api_version = self._get_api_version('operation_status_result') if api_version == '2023-10-02-preview': @@ -1231,6 +1305,12 @@ def operation_status_result(self): from ..v2023_11_02_preview.aio.operations import OperationStatusResultOperations as OperationClass elif api_version == '2024-01-02-preview': from ..v2024_01_02_preview.aio.operations import OperationStatusResultOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import OperationStatusResultOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import OperationStatusResultOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_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 @@ -1310,6 +1390,9 @@ def operations(self): * 2024-01-01: :class:`Operations` * 2024-01-02-preview: :class:`Operations` * 2024-02-01: :class:`Operations` + * 2024-02-02-preview: :class:`Operations` + * 2024-03-02-preview: :class:`Operations` + * 2024-04-02-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -1452,6 +1535,12 @@ def operations(self): from ..v2024_01_02_preview.aio.operations import Operations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import Operations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import Operations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import Operations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -1519,6 +1608,9 @@ def private_endpoint_connections(self): * 2024-01-01: :class:`PrivateEndpointConnectionsOperations` * 2024-01-02-preview: :class:`PrivateEndpointConnectionsOperations` * 2024-02-01: :class:`PrivateEndpointConnectionsOperations` + * 2024-02-02-preview: :class:`PrivateEndpointConnectionsOperations` + * 2024-03-02-preview: :class:`PrivateEndpointConnectionsOperations` + * 2024-04-02-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -1637,6 +1729,12 @@ def private_endpoint_connections(self): from ..v2024_01_02_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -1702,6 +1800,9 @@ def private_link_resources(self): * 2024-01-01: :class:`PrivateLinkResourcesOperations` * 2024-01-02-preview: :class:`PrivateLinkResourcesOperations` * 2024-02-01: :class:`PrivateLinkResourcesOperations` + * 2024-02-02-preview: :class:`PrivateLinkResourcesOperations` + * 2024-03-02-preview: :class:`PrivateLinkResourcesOperations` + * 2024-04-02-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -1816,6 +1917,12 @@ def private_link_resources(self): from ..v2024_01_02_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -1881,6 +1988,9 @@ def resolve_private_link_service_id(self): * 2024-01-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2024-01-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` * 2024-02-01: :class:`ResolvePrivateLinkServiceIdOperations` + * 2024-02-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` + * 2024-03-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` + * 2024-04-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -1995,6 +2105,12 @@ def resolve_private_link_service_id(self): from ..v2024_01_02_preview.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -2053,6 +2169,9 @@ def snapshots(self): * 2024-01-01: :class:`SnapshotsOperations` * 2024-01-02-preview: :class:`SnapshotsOperations` * 2024-02-01: :class:`SnapshotsOperations` + * 2024-02-02-preview: :class:`SnapshotsOperations` + * 2024-03-02-preview: :class:`SnapshotsOperations` + * 2024-04-02-preview: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2021-08-01': @@ -2153,6 +2272,12 @@ def snapshots(self): from ..v2024_01_02_preview.aio.operations import SnapshotsOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -2188,6 +2313,9 @@ def trusted_access_role_bindings(self): * 2024-01-01: :class:`TrustedAccessRoleBindingsOperations` * 2024-01-02-preview: :class:`TrustedAccessRoleBindingsOperations` * 2024-02-01: :class:`TrustedAccessRoleBindingsOperations` + * 2024-02-02-preview: :class:`TrustedAccessRoleBindingsOperations` + * 2024-03-02-preview: :class:`TrustedAccessRoleBindingsOperations` + * 2024-04-02-preview: :class:`TrustedAccessRoleBindingsOperations` """ api_version = self._get_api_version('trusted_access_role_bindings') if api_version == '2022-04-02-preview': @@ -2242,6 +2370,12 @@ def trusted_access_role_bindings(self): from ..v2024_01_02_preview.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 @@ -2277,6 +2411,9 @@ def trusted_access_roles(self): * 2024-01-01: :class:`TrustedAccessRolesOperations` * 2024-01-02-preview: :class:`TrustedAccessRolesOperations` * 2024-02-01: :class:`TrustedAccessRolesOperations` + * 2024-02-02-preview: :class:`TrustedAccessRolesOperations` + * 2024-03-02-preview: :class:`TrustedAccessRolesOperations` + * 2024-04-02-preview: :class:`TrustedAccessRolesOperations` """ api_version = self._get_api_version('trusted_access_roles') if api_version == '2022-04-02-preview': @@ -2331,6 +2468,12 @@ def trusted_access_roles(self): from ..v2024_01_02_preview.aio.operations import TrustedAccessRolesOperations as OperationClass elif api_version == '2024-02-01': from ..v2024_02_01.aio.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2024-02-02-preview': + from ..v2024_02_02_preview.aio.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2024-03-02-preview': + from ..v2024_03_02_preview.aio.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2024-04-02-preview': + from ..v2024_04_02_preview.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 3fe33a880135..a8c6d980b2c4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models.py @@ -7,5 +7,4 @@ from .v2019_04_01.models import * from .v2019_04_30.models import * from .v2022_09_02_preview.models import * -from .v2024_01_02_preview.models import * from .v2024_02_01.models import * 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 215f19d5391f..e5754a47ce68 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 = "30.0.0" +VERSION = "1.0.0b1" 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 2c1350bad28e..1d76417c6219 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,6 +40,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ContainerService"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-07-01")) cls: ClsType[_models.ContainerServiceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -151,7 +156,7 @@ async def _create_or_update_initial( parameters: Union[_models.ContainerService, IO[bytes]], **kwargs: Any ) -> _models.ContainerService: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -371,7 +376,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -417,7 +422,7 @@ async def get( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, container_service_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -538,7 +543,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-07-01")) cls: ClsType[_models.ContainerServiceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 6627938f3d8f..3d99f3f7b431 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -222,7 +227,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ContainerService"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-07-01")) cls: ClsType[_models.ContainerServiceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +296,7 @@ def _create_or_update_initial( parameters: Union[_models.ContainerService, IO[bytes]], **kwargs: Any ) -> _models.ContainerService: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ def get(self, resource_group_name: str, container_service_name: str, **kwargs: A :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -555,7 +560,7 @@ def get(self, resource_group_name: str, container_service_name: str, **kwargs: A def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, container_service_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -672,7 +677,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2017-07-01")) cls: ClsType[_models.ContainerServiceListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py index a7d04487f07f..e3d626bee34a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,6 +47,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-31")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-31")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +257,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -314,7 +319,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +379,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +438,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -742,7 +747,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -931,7 +936,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1030,7 +1035,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1215,7 +1220,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py index a2d46447b31e..2e65a511b145 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-31")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_managed_clusters_operations.py index 3d62bca673e2..bafcea68f586 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -440,7 +445,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-31")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-31")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -664,7 +669,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -724,7 +729,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -783,7 +788,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -840,7 +845,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -890,7 +895,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1097,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1281,7 +1286,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1380,7 +1385,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1565,7 +1570,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_operations.py index 36e4e852308d..736e4545c315 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2018-03-31")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py index 2680e4bc46f8..70628261f23e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,6 +47,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +181,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -256,7 +261,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +325,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +387,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -502,7 +507,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -554,7 +559,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -761,7 +766,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +960,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1247,7 +1252,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py index c30857c0c7af..7d39b2163422 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_managed_clusters_operations.py index 499ead198653..c421082d2dd4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -448,7 +453,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -532,7 +537,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -612,7 +617,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -676,7 +681,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -738,7 +743,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -799,7 +804,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -858,7 +863,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -910,7 +915,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1117,7 +1122,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1311,7 +1316,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1414,7 +1419,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1603,7 +1608,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_operations.py index 325bcf69db37..d593d2e1dad2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py index 6281803b26f2..fdaea3eeb92c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster" ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ def list_by_resource_group( ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -249,7 +254,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ async def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/_open_shift_managed_clusters_operations.py index 865395bc0811..7e618d9d9ed2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/operations/_open_shift_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -262,7 +267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftManagedCluster"]: ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +354,7 @@ def list_by_resource_group( ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2018_09_30_preview.models.OpenShiftManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -686,7 +691,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py index b7cadfc6198d..6b5309aad6a7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_cluster_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py index eff2a9023b50..d89da7330dd0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,6 +47,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +257,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -314,7 +319,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +379,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +438,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -742,7 +747,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -931,7 +936,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1030,7 +1035,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1215,7 +1220,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py index 46fe60aa9f8e..99650131293a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_agent_pools_operations.py index 4a756e09126b..9e4025c3056f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -210,7 +215,7 @@ def list(self, resource_group_name: str, managed_cluster_name: str, **kwargs: An api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +297,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_cluster_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_managed_clusters_operations.py index c14b37f3d8ff..41e167e81c5c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -452,7 +457,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -614,7 +619,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -676,7 +681,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -736,7 +741,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -795,7 +800,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -852,7 +857,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -902,7 +907,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1104,7 +1109,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1293,7 +1298,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1392,7 +1397,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1577,7 +1582,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_operations.py index ca083662810a..59d648ba5970 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py index 20c3d216befe..0019ce4675f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -218,7 +223,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +429,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_container_services_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_container_services_operations.py index 465ab6bf35c3..624e831cae6f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_container_services_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_container_services_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._container_services_operations import build_list_orchestrators_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ async def list_orchestrators( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.OrchestratorVersionProfileListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py index 4a359754a62f..822a75fd8da3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,6 +47,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +257,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -314,7 +319,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +379,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +438,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -742,7 +747,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -931,7 +936,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1030,7 +1035,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1215,7 +1220,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py index 4e19f4a14b62..cfe09b44f39f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models_py3.py index be5bb2e1f72b..04db9084f35c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/models/_models_py3.py @@ -1897,7 +1897,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -1926,7 +1926,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_agent_pools_operations.py index f3c82aa3d8a3..f74de7be7c3d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -238,7 +243,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +325,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_container_services_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_container_services_operations.py index eeea957dc028..40d0cd94b621 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_container_services_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_container_services_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list_orchestrators( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.OrchestratorVersionProfileListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_managed_clusters_operations.py index 8939e90cec88..c926c2da69fa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -522,7 +527,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -746,7 +751,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -806,7 +811,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -865,7 +870,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -922,7 +927,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -972,7 +977,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1174,7 +1179,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1363,7 +1368,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1462,7 +1467,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1647,7 +1652,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_operations.py index 130b648e856f..ec26801a43e6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py index fa29a1dfae70..9891b30f57dd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/operations/_open_shift_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,7 +88,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster" api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-30")) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-30")) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +250,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -295,7 +300,7 @@ async def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -498,7 +503,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -689,7 +694,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/_open_shift_managed_clusters_operations.py index bf609ea39d7a..47e27b3a9338 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/_open_shift_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-30")) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +350,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-04-30")) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +427,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_04_30.models.OpenShiftManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +680,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -866,7 +871,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py index cf8ee4f45686..4c95370c29c9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py index a6c1518831f4..cc70a1d0369e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,6 +47,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +257,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -314,7 +319,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +379,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +438,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -742,7 +747,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -931,7 +936,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1030,7 +1035,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1215,7 +1220,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py index e97f6e2b2d06..85ca2e3ed82f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models_py3.py index d7bed031315f..70ef0119c5b8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/models/_models_py3.py @@ -2194,7 +2194,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -2223,7 +2223,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_agent_pools_operations.py index 0074b50d7ea2..26265edca87b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_managed_clusters_operations.py index 507750af37ed..821e35f83614 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -522,7 +527,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -746,7 +751,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -806,7 +811,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -865,7 +870,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -922,7 +927,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -972,7 +977,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1174,7 +1179,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1363,7 +1368,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1462,7 +1467,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1647,7 +1652,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_operations.py index 87894e512edc..a8d7226899ce 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py index 5db0fd97d234..624de05352a4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py index 07dce5e31563..e4660da46225 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -47,6 +48,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -173,7 +178,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -253,7 +258,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +320,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -375,7 +380,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -434,7 +439,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +496,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -541,7 +546,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -743,7 +748,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -932,7 +937,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1031,7 +1036,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1216,7 +1221,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1394,7 +1399,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py index 8041afe812ed..6cda416c4e44 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models_py3.py index 0492068ef59f..ae163bf364ea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/models/_models_py3.py @@ -2372,7 +2372,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -2401,7 +2401,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_agent_pools_operations.py index 09da04f344e2..49d7cc72e79b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_managed_clusters_operations.py index b5aebde2c451..e34a4010c570 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -560,7 +565,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -722,7 +727,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -784,7 +789,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -844,7 +849,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -903,7 +908,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -960,7 +965,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1010,7 +1015,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1212,7 +1217,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1401,7 +1406,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1500,7 +1505,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1685,7 +1690,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1863,7 +1868,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_operations.py index 082c2f8f12f6..73af5ebb05a9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-08-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 215f19d5391f..e5754a47ce68 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 = "30.0.0" +VERSION = "1.0.0b1" 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 71bfa40a0f76..3ceb6c15ce1e 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster" ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ def list_by_resource_group( ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -249,7 +254,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ async def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 9d93800c3555..dc59035f7e81 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -262,7 +267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftManagedCluster"]: ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +354,7 @@ def list_by_resource_group( ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_09_30_preview.models.OpenShiftManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -686,7 +691,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py index 031dcfd70c47..271d0f30acee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py index f1c70c64ec43..f88a291d008b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -48,6 +49,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +179,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -495,7 +500,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +557,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -993,7 +998,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1097,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1282,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1460,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py index 9bef285146dd..ec618b1924cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models_py3.py index 8428ed3d70b5..e3c50405ce52 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/models/_models_py3.py @@ -2377,7 +2377,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -2406,7 +2406,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_agent_pools_operations.py index e1f194425842..8b5dd0269843 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_managed_clusters_operations.py index e9edeb04a464..ee854d16ea3f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -598,7 +603,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +765,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +827,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -941,7 +946,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1001,7 +1006,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1108,7 +1113,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1310,7 +1315,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1499,7 +1504,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1598,7 +1603,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1783,7 +1788,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1961,7 +1966,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_operations.py index 8f6f9021a548..beb3885b4253 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py index c2be6bc2f105..4c5fa1217582 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/operations/_open_shift_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster" ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ def list_by_resource_group( ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -249,7 +254,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ async def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py index 1cdc6d99b632..73df5359b2db 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/operations/_open_shift_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -262,7 +267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftManagedCluster"]: ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -349,7 +354,7 @@ def list_by_resource_group( ) cls: ClsType[_models.OpenShiftManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_10_27_preview.models.OpenShiftManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -686,7 +691,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py index 671fc8201707..a724c5b4b11c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py index 3bfeea1e6a99..621bfc78ff97 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -48,6 +49,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +179,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -495,7 +500,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +557,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -993,7 +998,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1097,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1282,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1460,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py index 8fbcb3cb8b2d..09e5e9f34f75 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models_py3.py index c676712a5d0b..f441fd9b258a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/models/_models_py3.py @@ -2536,7 +2536,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -2565,7 +2565,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_agent_pools_operations.py index b7d8dc0026d2..81c7320a9f3b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_managed_clusters_operations.py index 9d2583ea9df2..7c0da429b30f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -598,7 +603,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +765,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +827,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -941,7 +946,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1001,7 +1006,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1108,7 +1113,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1310,7 +1315,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1499,7 +1504,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1598,7 +1603,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1783,7 +1788,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1961,7 +1966,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_operations.py index 2e3475e10be8..7c8b8a09ec60 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2019-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py index 17289a4f8607..c473c625c871 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-01-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py index 69aef825c0a0..f8714d9a6014 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -48,6 +49,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +179,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -495,7 +500,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +557,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -993,7 +998,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1097,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1282,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1460,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py index 9db97beb090f..e9806f1e9e1c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models_py3.py index ceb98c300293..a03cb621f4dd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/models/_models_py3.py @@ -2545,7 +2545,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -2574,7 +2574,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_agent_pools_operations.py index 91387165bcf7..4ed1a14c692f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-01-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_managed_clusters_operations.py index 602375bbd0a5..8e6515882a22 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -598,7 +603,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +765,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +827,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -941,7 +946,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1001,7 +1006,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1108,7 +1113,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1310,7 +1315,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1499,7 +1504,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1598,7 +1603,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1783,7 +1788,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1961,7 +1966,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_operations.py index 6040de568565..627fabb4348f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py index ca8e90893a32..3035831f9809 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py index 962d8fad7f27..8bf891a46410 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -48,6 +49,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +179,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -495,7 +500,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +557,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -993,7 +998,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1097,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1282,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1460,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py index 69090be57d1c..71bef371c834 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models_py3.py index 15eca2216298..8b83ae744695 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/models/_models_py3.py @@ -2673,7 +2673,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -2702,7 +2702,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_agent_pools_operations.py index b608266b4a29..0a26d9b138f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_managed_clusters_operations.py index c34f80823863..d8b57f429536 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -598,7 +603,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +765,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +827,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -941,7 +946,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1001,7 +1006,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1108,7 +1113,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1310,7 +1315,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1499,7 +1504,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1598,7 +1603,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1783,7 +1788,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1961,7 +1966,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py index 03cc2b0f3025..6e235fa5c143 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 215f19d5391f..e5754a47ce68 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 = "30.0.0" +VERSION = "1.0.0b1" 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 128c6961f292..11e5974a89d2 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 02932c43b1e9..427e28a2a22b 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -48,6 +49,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +179,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -316,7 +321,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -495,7 +500,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +557,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -993,7 +998,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1097,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1282,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1455,7 +1460,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 3dbdfbded318..ef4763202eb5 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 @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 0e07897e1eb4..03b817e2b2ae 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 @@ -2988,7 +2988,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -3017,7 +3017,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str 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 fd07c7f72d02..f337587d75aa 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 b5e2d2c38dd3..2e56c4904d26 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -598,7 +603,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +765,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -822,7 +827,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -941,7 +946,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1001,7 +1006,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1108,7 +1113,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1310,7 +1315,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1499,7 +1504,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1598,7 +1603,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1783,7 +1788,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1961,7 +1966,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 8081b545e6a1..fc8d1238a9c8 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 @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py index f5f404129cc6..397ef40ae963 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py index 4acd3dd751df..a275ec2201c2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -48,6 +49,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +179,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -320,7 +325,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +385,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -439,7 +444,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -499,7 +504,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -556,7 +561,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -606,7 +611,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -997,7 +1002,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1096,7 +1101,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1281,7 +1286,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1459,7 +1464,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py index d8b748a28249..c9377989f4c4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py index 08d0e558f285..335920871a10 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/models/_models_py3.py @@ -3067,7 +3067,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -3096,7 +3096,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py index e45d19b59ebd..99cabb6fa4d5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py index b5d70f75bba9..fb05933fa734 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -598,7 +603,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +765,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -826,7 +831,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +891,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -945,7 +950,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1005,7 +1010,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1067,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1112,7 +1117,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1319,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1503,7 +1508,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1602,7 +1607,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1787,7 +1792,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1965,7 +1970,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py index 907f88e3c198..a7a1a5a264c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py index 4185fba23df3..48239911a27c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,6 +41,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +608,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py index 11ba502633d3..a7b9d878e9cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -48,6 +49,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +179,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -320,7 +325,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +385,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -439,7 +444,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -499,7 +504,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -556,7 +561,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -606,7 +611,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -997,7 +1002,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1096,7 +1101,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1281,7 +1286,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1459,7 +1464,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py index 9634b88d6144..e202fa3c9e7b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py index 1dc668c997e1..497481a85114 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +142,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +277,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py index 9b567b47e41a..9dfb38871c39 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/models/_models_py3.py @@ -3150,7 +3150,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -3179,7 +3179,7 @@ def __init__(self, *, admin_username: str, admin_password: Optional[str] = None, :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py index 1d80332c2324..1109c3b4a880 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +402,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -829,7 +834,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py index 83f8eb6ba671..b2c7015b6da8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -598,7 +603,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +765,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -826,7 +831,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +891,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -945,7 +950,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1005,7 +1010,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1067,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1112,7 +1117,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1319,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1503,7 +1508,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1602,7 +1607,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1787,7 +1792,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1965,7 +1970,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py index 486730d09130..2843c69e6d83 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py index 9cf2a9384f46..720f05dee6da 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py index bf6445656084..2cea6203a78d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +226,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +432,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +655,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py index 7252de082070..939181032037 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -48,6 +49,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -174,7 +179,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -254,7 +259,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -320,7 +325,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +385,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -439,7 +444,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -499,7 +504,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -556,7 +561,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -606,7 +611,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -997,7 +1002,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1096,7 +1101,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1281,7 +1286,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1459,7 +1464,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py index 0a49892b6a3c..173fc285839d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py index 14ed8e0805e6..77430a3fa1cd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +142,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +277,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py index 997b36096b00..476b9a51ad5c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/models/_models_py3.py @@ -3143,7 +3143,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -3183,7 +3183,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py index 8f4801d2f479..f0e7b9507921 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -354,7 +359,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +493,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +696,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +873,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -914,7 +919,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py index 005a7964b5f4..1e5e5a03f610 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -598,7 +603,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -760,7 +765,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -826,7 +831,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +891,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -945,7 +950,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1005,7 +1010,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1067,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1112,7 +1117,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1319,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1503,7 +1508,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1602,7 +1607,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1787,7 +1792,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1965,7 +1970,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py index ef1586110069..2c19aadfe31e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py index 6a7b200f59d6..3854cde2f57e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py index 1366903fd53d..78900f5564c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +226,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +432,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +655,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py index e90c0e73e8b3..612f0806f17c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -50,6 +51,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +181,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -256,7 +261,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +311,7 @@ async def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -322,7 +327,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +387,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +446,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +506,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -558,7 +563,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -608,7 +613,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -999,7 +1004,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1098,7 +1103,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1283,7 +1288,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1461,7 +1466,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1558,7 +1563,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1653,7 +1658,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py index e8617240ad64..c9b6ad181a8d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py index 7fab24bd5892..ab7556e7567b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +142,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +277,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py index 17d66c74e65c..6bc84b8b8ee6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py index 784ea4613116..0583b6981750 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -134,7 +139,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py index 28b19c5442da..cd1ad465fb04 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/models/_models_py3.py @@ -3251,7 +3251,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -3291,7 +3291,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py index 99411e2dd469..17d039575572 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -354,7 +359,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +493,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +696,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +873,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -914,7 +919,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py index 83d2e07f623e..6bce709b2a01 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -674,7 +679,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -756,7 +761,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -836,7 +841,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +891,7 @@ def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -902,7 +907,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -962,7 +967,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1021,7 +1026,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1081,7 +1086,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1143,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1390,7 +1395,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1579,7 +1584,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1678,7 +1683,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1863,7 +1868,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2041,7 +2046,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2233,7 +2238,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py index 7b531b21d6e7..db2deea2b73c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py index 92574b17324a..a23ca024213e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py index 5df2cd8f039a..5f0405ca510d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py index 1d80e62638a6..4a8f4a96dbdc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 215f19d5391f..e5754a47ce68 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 = "30.0.0" +VERSION = "1.0.0b1" 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 7c73f9477d98..4331f3657110 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-11-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +226,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +432,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +655,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 da98bcd0fd41..5b4e7c8ec420 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -50,6 +51,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +181,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -256,7 +261,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +311,7 @@ async def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -322,7 +327,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +387,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +446,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +506,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -558,7 +563,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -608,7 +613,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -999,7 +1004,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1098,7 +1103,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1283,7 +1288,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1461,7 +1466,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1558,7 +1563,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1653,7 +1658,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 31abc388c288..c9e2e1cebf63 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 @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 c9d575a85106..e145d40bd11f 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +142,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +277,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 d7f0b1c33bd4..4afdf31bea6d 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 @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 e9063e8f52ad..e5d60bc19a71 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -134,7 +139,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 e7a5fefa6af3..aaf94baa1ab8 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 @@ -1551,7 +1551,7 @@ class KubeletConfig(_serialization.Model): :ivar topology_manager_policy: Topology Manager policy to use. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in - ``*``\ ). + ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1599,7 +1599,7 @@ def __init__( :keyword topology_manager_policy: Topology Manager policy to use. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -3732,7 +3732,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -3772,7 +3772,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str 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 b72a5bd45fa5..c74d950ea8aa 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -354,7 +359,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-11-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +493,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +696,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +873,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -914,7 +919,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 c4bb03782cc7..964e786b205d 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -674,7 +679,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -756,7 +761,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -836,7 +841,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +891,7 @@ def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -902,7 +907,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -962,7 +967,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1021,7 +1026,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1081,7 +1086,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1143,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1390,7 +1395,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1579,7 +1584,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1678,7 +1683,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1863,7 +1868,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2041,7 +2046,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2233,7 +2238,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 3d693a7880d5..142999ae2fef 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 @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 1088f3c813c5..b8045ec2d6fd 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 cbae1d7c8e58..003018dd3253 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 @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 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 21dce9bc8363..f13d027f8755 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 @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_agent_pools_operations.py index 1e72af0a2510..5507fca8ee67 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +226,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +432,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +655,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_maintenance_configurations_operations.py index fdb3c14f83cb..8cc87ede2fde 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +307,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_managed_clusters_operations.py index a41cfeaf4df7..250b5899cee8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -50,6 +51,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +181,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -256,7 +261,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +311,7 @@ async def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -322,7 +327,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +387,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +446,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +506,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -558,7 +563,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -608,7 +613,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -999,7 +1004,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1098,7 +1103,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1283,7 +1288,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1461,7 +1466,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1558,7 +1563,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1653,7 +1658,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_operations.py index 96d42df5546a..d381f0f6572f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py index 7a7481378416..9fccff7c7a15 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +142,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +277,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_link_resources_operations.py index e5b7bd0a8b06..addb363bc89a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_resolve_private_link_service_id_operations.py index b0e39f27d314..f384ae9a628f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -134,7 +139,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models_py3.py index d719ab27a524..7c0a7a6eff11 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/models/_models_py3.py @@ -1572,7 +1572,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- :ivar topology_manager_policy: Topology Manager policy to use. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in - ``*``\ ). + ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1638,7 +1638,7 @@ def __init__( :keyword topology_manager_policy: Topology Manager policy to use. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -3915,7 +3915,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -3955,7 +3955,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_agent_pools_operations.py index 1999486d1b28..d112792bea08 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -354,7 +359,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +493,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +696,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +873,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -914,7 +919,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py index 6a45fc5b3c77..28404235424a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -240,7 +245,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +462,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -531,7 +536,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_managed_clusters_operations.py index 6279d8da0ef5..d39417968d70 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -674,7 +679,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -756,7 +761,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -836,7 +841,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +891,7 @@ def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -902,7 +907,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -962,7 +967,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1021,7 +1026,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1081,7 +1086,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1143,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1390,7 +1395,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1579,7 +1584,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1678,7 +1683,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1863,7 +1868,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2041,7 +2046,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2233,7 +2238,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_operations.py index 835e58e1f9be..332cd845cb37 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2020-12-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py index e199bd21dbc9..66eb0f5ee564 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_link_resources_operations.py index 94efa99e7c78..753e7a8f3570 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_resolve_private_link_service_id_operations.py index 2f7e3c146881..0c63be0701ea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_agent_pools_operations.py index 5ee3cc83f1db..c080960a9be4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +226,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +432,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +655,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_maintenance_configurations_operations.py index 88fd50b7aa88..fe73ab78e203 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +307,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_managed_clusters_operations.py index 52c1453c1960..db043fe6c9b2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -50,6 +51,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -176,7 +181,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -256,7 +261,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -306,7 +311,7 @@ async def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -322,7 +327,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -382,7 +387,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +446,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -501,7 +506,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -558,7 +563,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -608,7 +613,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -999,7 +1004,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1098,7 +1103,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1283,7 +1288,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1461,7 +1466,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1558,7 +1563,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1653,7 +1658,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_operations.py index a00284ec7dcd..657613eab0c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py index a740a67e982b..1ba743b9e5c1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +142,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +277,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_link_resources_operations.py index 1f434d980fe3..7dc12b01086e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_resolve_private_link_service_id_operations.py index 7449d92b659e..08cab5999392 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -134,7 +139,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models_py3.py index 02f4a92366de..795264d81444 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/models/_models_py3.py @@ -1595,7 +1595,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- :ivar topology_manager_policy: Topology Manager policy to use. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in - ``*``\ ). + ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1661,7 +1661,7 @@ def __init__( :keyword topology_manager_policy: Topology Manager policy to use. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -3980,7 +3980,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4020,7 +4020,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_agent_pools_operations.py index a27e2037e26d..d1133860b171 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -354,7 +359,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +493,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +696,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +873,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -914,7 +919,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_maintenance_configurations_operations.py index 4695a0cd171e..f31f2be6afe3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -240,7 +245,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +462,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -531,7 +536,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_managed_clusters_operations.py index 7a7cf64742f1..2f4f53fa4b3b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -674,7 +679,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -756,7 +761,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -836,7 +841,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +891,7 @@ def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -902,7 +907,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -962,7 +967,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1021,7 +1026,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1081,7 +1086,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1143,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1390,7 +1395,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1579,7 +1584,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1678,7 +1683,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1863,7 +1868,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2041,7 +2046,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2233,7 +2238,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_operations.py index 2e47dc3cbb53..a4b9ece28f37 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_endpoint_connections_operations.py index 55cd03b03e54..b11e7d4b97b7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_link_resources_operations.py index 7acdd7edd7f3..9dcfb939db4c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_resolve_private_link_service_id_operations.py index 93df63b71241..52dc8bcab850 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_agent_pools_operations.py index 3d88a68984c4..36d49debed1f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,7 +226,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -427,7 +432,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +609,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +655,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_maintenance_configurations_operations.py index 76aba3344c52..59dfcfedc504 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +172,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +307,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_managed_clusters_operations.py index bee20322e625..9574cdb8b65b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -53,6 +54,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +324,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +374,7 @@ async def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -385,7 +390,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +450,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +509,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -564,7 +569,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -621,7 +626,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -671,7 +676,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +878,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1062,7 +1067,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1161,7 +1166,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1346,7 +1351,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1524,7 +1529,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1621,7 +1626,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1716,7 +1721,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1820,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2025,7 +2030,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_operations.py index 2f9167e31eba..bcad87e6e7ca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_endpoint_connections_operations.py index fa83c1f0e7f5..ca5ee18915ee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +142,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -272,7 +277,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_link_resources_operations.py index 6810b8ea91a2..ce708e91a97d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_resolve_private_link_service_id_operations.py index e07e674f71f0..6861998896d4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -134,7 +139,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models_py3.py index acc2e31afe77..a49a810cef10 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/models/_models_py3.py @@ -1610,7 +1610,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- :ivar topology_manager_policy: Topology Manager policy to use. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending in - ``*``\ ). + ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1676,7 +1676,7 @@ def __init__( :keyword topology_manager_policy: Topology Manager policy to use. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowlist of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4003,7 +4003,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4047,7 +4047,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_agent_pools_operations.py index 6b75657b510f..51b1194771d8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -354,7 +359,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -488,7 +493,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -691,7 +696,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -808,7 +813,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -868,7 +873,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -914,7 +919,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_maintenance_configurations_operations.py index 4dfff3de5927..abedba618cc9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -240,7 +245,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +462,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -531,7 +536,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_managed_clusters_operations.py index a6cb5e42bfd2..9c14a17abc67 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -785,7 +790,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -846,7 +851,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -928,7 +933,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1008,7 +1013,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get_access_profile( """Gets an access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified - resource group and name. **WARNING**\ : This API will be deprecated. Instead use + resource group and name. **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials @@ -1074,7 +1079,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1134,7 +1139,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1193,7 +1198,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1253,7 +1258,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1310,7 +1315,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1360,7 +1365,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1562,7 +1567,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1751,7 +1756,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1850,7 +1855,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2035,7 +2040,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2213,7 +2218,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2310,7 +2315,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2405,7 +2410,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2504,7 +2509,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2714,7 +2719,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_operations.py index a98d3743b416..5a299c881626 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -90,7 +95,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_endpoint_connections_operations.py index 6ad060670c29..941078452717 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +451,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_link_resources_operations.py index cfec25cbf9a8..17c69c292d3f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_resolve_private_link_service_id_operations.py index 6a37a3492bc0..379d5e6f6a06 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_agent_pools_operations.py index 877e1444d933..b9af93d4d039 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +429,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +653,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_maintenance_configurations_operations.py index a08bd96d1bb6..e54e36ffa62e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +304,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_managed_clusters_operations.py index 5e6ce57d87a6..432eec1832c4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -381,7 +386,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +630,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +680,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +877,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1066,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1342,7 +1347,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1518,7 +1523,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1616,7 +1621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1715,7 +1720,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1820,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2028,7 +2033,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2100,7 +2105,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_operations.py index 5eccfc5df571..d4e0faffa8af 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_endpoint_connections_operations.py index af66fb6528ba..26a82b382951 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +276,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +335,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_link_resources_operations.py index 161b9a572180..2d5d9b68d9b3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_resolve_private_link_service_id_operations.py index 136bbfa2d6bf..cac8bda74272 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models_py3.py index 84a2e04071ee..4e28a7a50fe3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/models/_models_py3.py @@ -1741,7 +1741,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1812,7 +1812,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4379,7 +4379,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4425,7 +4425,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_agent_pools_operations.py index 9f7c5ebefdbb..0308bc02d95f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -353,7 +358,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -866,7 +871,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +917,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py index 3d40f2a0d57a..fc4eeb991b4e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -239,7 +244,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_managed_clusters_operations.py index bc6873be3f70..d81f72c48f44 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -844,7 +849,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -904,7 +909,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -985,7 +990,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1064,7 +1069,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1113,7 +1118,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1128,7 +1133,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1195,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1252,7 +1257,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1319,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1372,7 +1377,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1619,7 +1624,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1808,7 +1813,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1907,7 +1912,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2089,7 +2094,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2265,7 +2270,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2363,7 +2368,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2462,7 +2467,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2562,7 +2567,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2775,7 +2780,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2847,7 +2852,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_operations.py index 5bdd964d9869..1d58da396bd5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-05-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_endpoint_connections_operations.py index 498517e86f8a..793870c54850 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +317,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +450,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +509,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_link_resources_operations.py index c895d7ddc8ac..a3399dcf2336 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_resolve_private_link_service_id_operations.py index a53a77547fdf..a90591327867 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -176,7 +181,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_agent_pools_operations.py index e71fe2b59684..30a4dc28c60f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +429,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +653,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_maintenance_configurations_operations.py index 9b945e557d34..c53f1bd795e8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +304,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_managed_clusters_operations.py index d7e70ed67b62..165e612f0dfd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -381,7 +386,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +630,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +680,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +877,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1066,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1342,7 +1347,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1518,7 +1523,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1616,7 +1621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1715,7 +1720,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1820,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2028,7 +2033,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2100,7 +2105,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_operations.py index 8dbccf1989b2..de86be2fdbfb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py index ccb3938a9e02..8b4f83b603f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +276,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +335,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_link_resources_operations.py index 912515537b49..bf3e27fa4ef2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_resolve_private_link_service_id_operations.py index 7a43e3df2cb0..96817f1da57b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models_py3.py index 77c5869d822e..4670888b1a53 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/models/_models_py3.py @@ -1388,7 +1388,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1459,7 +1459,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4192,7 +4192,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4238,7 +4238,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_agent_pools_operations.py index 962cfd7950d0..55629306997f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -353,7 +358,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -866,7 +871,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +917,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_maintenance_configurations_operations.py index e29c461e1dae..1a679e20fcee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -239,7 +244,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_managed_clusters_operations.py index 83fff53a7137..2d46ef088f52 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -844,7 +849,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -904,7 +909,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -985,7 +990,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1064,7 +1069,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1113,7 +1118,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1128,7 +1133,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1195,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1252,7 +1257,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1319,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1372,7 +1377,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1619,7 +1624,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1808,7 +1813,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1907,7 +1912,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2089,7 +2094,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2265,7 +2270,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2363,7 +2368,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2462,7 +2467,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2562,7 +2567,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2775,7 +2780,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2847,7 +2852,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_operations.py index 640c7a91fc38..7ca30f036d15 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_endpoint_connections_operations.py index c37573502b90..39b45e518fbd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +317,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +450,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +509,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_link_resources_operations.py index f111510ee25d..de841e7d0dce 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_resolve_private_link_service_id_operations.py index f62a2c25a533..5ecb9f9a730c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -176,7 +181,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py index fface9ca3413..9c90e17fd0d9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +429,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +653,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py index 06c6118e9262..736f26d35237 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +304,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py index 3cbcf29495e8..6d42c5074aea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -381,7 +386,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +630,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +680,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +877,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1066,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1342,7 +1347,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1518,7 +1523,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1616,7 +1621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1715,7 +1720,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1820,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2028,7 +2033,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2100,7 +2105,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py index cf488c537acb..2e469ff6e892 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py index 4e712f85bbd1..87363967079b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +276,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +335,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py index f31c6e62b2af..074f937130f7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py index 9859a6a6ac44..c7db4236ee0b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py index f190c419eab0..8e2ecc99d87f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +242,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +364,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +502,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +573,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py index 5da5dda5f174..17b451659b2d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/models/_models_py3.py @@ -1430,7 +1430,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1501,7 +1501,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4301,7 +4301,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4347,7 +4347,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py index dda36c53c846..af57b766265e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -353,7 +358,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -866,7 +871,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +917,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py index d8fecf229aff..32ae52497919 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -239,7 +244,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py index b269b57a96d6..3d2b9647fa1c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -844,7 +849,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -904,7 +909,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -985,7 +990,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1064,7 +1069,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1113,7 +1118,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1128,7 +1133,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1195,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1252,7 +1257,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1319,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1372,7 +1377,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1619,7 +1624,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1808,7 +1813,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1907,7 +1912,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2089,7 +2094,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2265,7 +2270,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2363,7 +2368,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2462,7 +2467,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2562,7 +2567,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2775,7 +2780,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2847,7 +2852,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py index c75ea0999194..76022c4e7e33 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py index 0e5455512268..d0758175b9e5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +317,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +450,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +509,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py index b2b3e9184b4e..724c3ea56353 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py index b1b08872a542..4875309d554c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -176,7 +181,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py index d28aeb16e7c1..cff0ecbe89b6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -281,7 +286,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -361,7 +366,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-08-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +443,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +565,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_agent_pools_operations.py index 04f3575bf16f..abbe7abccb49 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +429,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +653,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_maintenance_configurations_operations.py index b1a77d56ebc3..161b24236f19 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +304,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_managed_clusters_operations.py index 42bbe07abbd0..ac46e66afe9b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -381,7 +386,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +630,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +680,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +877,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1066,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1342,7 +1347,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1518,7 +1523,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1616,7 +1621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1715,7 +1720,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1820,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2028,7 +2033,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2100,7 +2105,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_operations.py index d6ba72172b78..651980f27457 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_endpoint_connections_operations.py index df9b2b47df08..c67bb577f647 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +276,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +335,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_link_resources_operations.py index 5e681ad68498..99e103be1edf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_resolve_private_link_service_id_operations.py index a5bf8b072da5..f88433f1e68d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_snapshots_operations.py index 14d84e026a7e..7e586954532c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +242,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +364,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +502,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +573,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models_py3.py index c24c3f5b19d5..f112b5c5e5d9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/models/_models_py3.py @@ -1438,7 +1438,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1509,7 +1509,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4326,7 +4326,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4376,7 +4376,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_agent_pools_operations.py index 51fba7b638cd..9fd38daae9c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -353,7 +358,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -866,7 +871,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +917,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_maintenance_configurations_operations.py index 0e47383ecfbf..05cf6b90dc4f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -239,7 +244,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_managed_clusters_operations.py index 596f893aedd1..4b93be4f9f6a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -844,7 +849,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -904,7 +909,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -985,7 +990,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1064,7 +1069,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1113,7 +1118,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1128,7 +1133,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1195,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1252,7 +1257,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1319,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1372,7 +1377,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1619,7 +1624,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1808,7 +1813,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1907,7 +1912,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2089,7 +2094,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2265,7 +2270,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2363,7 +2368,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2462,7 +2467,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2562,7 +2567,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2775,7 +2780,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2847,7 +2852,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_operations.py index 391492ad2f0a..babcc746b465 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_endpoint_connections_operations.py index 5ded9de2d7fa..ce13779abde0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +317,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +450,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +509,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_link_resources_operations.py index c8f14d821332..905dc23add54 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_resolve_private_link_service_id_operations.py index 425cc596645e..5f1fd1332243 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -176,7 +181,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_snapshots_operations.py index 43a02399a1a7..90f68b77a357 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -281,7 +286,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -361,7 +366,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +443,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +565,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_agent_pools_operations.py index 058c3e6033a2..78e7ad2a316a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +429,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +653,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_maintenance_configurations_operations.py index ce34e6e46f81..4580da945fba 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +304,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_managed_clusters_operations.py index 5bed8c54d3f0..91439d6ac352 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -381,7 +386,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +630,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -675,7 +680,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -872,7 +877,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1066,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1342,7 +1347,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1518,7 +1523,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1616,7 +1621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1715,7 +1720,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1815,7 +1820,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2028,7 +2033,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2100,7 +2105,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_operations.py index 1615d12432bb..67886a35c3e0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_endpoint_connections_operations.py index 2e2d28f1f614..808920519d86 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +276,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +335,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_link_resources_operations.py index 4f81af98d025..0fd63c3fb4aa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_resolve_private_link_service_id_operations.py index 08f95a2eeea0..77c185af14f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_snapshots_operations.py index 061b303fb5e8..485bbf72169e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +242,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +364,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +502,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +573,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models_py3.py index 7147d15e39d2..f5935516bf2f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/models/_models_py3.py @@ -1469,7 +1469,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1540,7 +1540,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4369,7 +4369,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4419,7 +4419,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_agent_pools_operations.py index e0ee842f8263..5f1f300f343e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -353,7 +358,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -866,7 +871,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +917,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_maintenance_configurations_operations.py index 73d0beeb88c2..9667f025ec86 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -239,7 +244,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_managed_clusters_operations.py index f3b50ec0ac17..2887ad1b50e6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -844,7 +849,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -904,7 +909,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -985,7 +990,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1064,7 +1069,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1113,7 +1118,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1128,7 +1133,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1195,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1252,7 +1257,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1314,7 +1319,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1372,7 +1377,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1619,7 +1624,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1808,7 +1813,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1907,7 +1912,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2089,7 +2094,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2265,7 +2270,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2363,7 +2368,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2462,7 +2467,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2562,7 +2567,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2775,7 +2780,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2847,7 +2852,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_operations.py index 188de5b9c5da..313a2445217f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_endpoint_connections_operations.py index dec4a7aec350..005567e5adf2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +317,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +450,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +509,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_link_resources_operations.py index 0ad71888eabb..6008488aa10f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_resolve_private_link_service_id_operations.py index a656ca8d9fda..eb4b7452cdd1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -176,7 +181,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_snapshots_operations.py index 3087aadda3fa..dffd9033a196 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -281,7 +286,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -361,7 +366,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2021-10-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +443,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +565,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_agent_pools_operations.py index 8df65d9b50fa..fbd7a2c4013f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +229,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +438,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -617,7 +622,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_maintenance_configurations_operations.py index 2ef05e3f59ad..1c54c9c2602c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +385,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_managed_clusters_operations.py index d1e514fd27e6..71dda8be6ad6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -159,7 +164,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +249,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +328,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +379,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -389,7 +394,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -453,7 +458,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -581,7 +586,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +646,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +698,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -895,7 +900,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1089,7 +1094,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1192,7 +1197,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1378,7 +1383,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1559,7 +1564,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1661,7 +1666,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1764,7 +1769,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1868,7 +1873,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2086,7 +2091,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2162,7 +2167,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_operations.py index 20d875b141df..899ce5f66e8c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_endpoint_connections_operations.py index 608a9b8e91a1..49dfa05cbadc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -141,7 +146,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -277,7 +282,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +343,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_link_resources_operations.py index 5bb9e29825c6..23fd836a14e8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_resolve_private_link_service_id_operations.py index b07e4d01b83c..635186054679 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_snapshots_operations.py index 64e30232d992..4499f926a4e8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +169,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +246,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +370,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +511,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -579,7 +584,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_models_py3.py index f4d1ed316c1f..8c36c93a98aa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/models/_models_py3.py @@ -1512,7 +1512,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1583,7 +1583,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4538,7 +4538,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4590,7 +4590,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_agent_pools_operations.py index 60eac5e77c2f..c0260de32888 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -356,7 +361,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +443,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +497,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -818,7 +823,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -930,7 +935,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_maintenance_configurations_operations.py index 2a3e0274f3d2..244616367004 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -241,7 +246,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +328,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -535,7 +540,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_managed_clusters_operations.py index a7fb296ce26c..acd79a5836ce 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -844,7 +849,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -908,7 +913,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1070,7 +1075,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1121,7 +1126,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1136,7 +1141,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1264,7 +1269,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1328,7 +1333,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1388,7 +1393,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1440,7 +1445,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1642,7 +1647,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1836,7 +1841,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1939,7 +1944,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2125,7 +2130,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2306,7 +2311,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2408,7 +2413,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2511,7 +2516,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2615,7 +2620,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2833,7 +2838,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2909,7 +2914,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_operations.py index 0f9e2a695b0a..cec27258d0aa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_endpoint_connections_operations.py index ee32db918aed..ba1ce7c1dbe3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -251,7 +256,7 @@ def list( ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +320,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +517,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_link_resources_operations.py index 78a8d8215f79..2b8df48730d1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_resolve_private_link_service_id_operations.py index c70bc4d3ee49..bfd5668de69b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -176,7 +181,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_snapshots_operations.py index 01841ffcb044..a3adf249a551 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -284,7 +289,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -367,7 +372,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +449,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +573,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -709,7 +714,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -782,7 +787,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_agent_pools_operations.py index b1610812fb96..735d442b52bc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -220,7 +225,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -424,7 +429,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -540,7 +545,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -602,7 +607,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -648,7 +653,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_maintenance_configurations_operations.py index ed5a48fdb1d8..55064234de76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -166,7 +171,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +304,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -373,7 +378,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_managed_clusters_operations.py index 464cb82c5584..a8a8fc20c74c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -317,7 +322,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -381,7 +386,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -515,7 +520,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -578,7 +583,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +641,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -686,7 +691,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -883,7 +888,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1072,7 +1077,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1171,7 +1176,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1353,7 +1358,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1529,7 +1534,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1627,7 +1632,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1726,7 +1731,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1826,7 +1831,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2039,7 +2044,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2111,7 +2116,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_operations.py index 8b1c7bfde60c..0dbcfe9387c6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_private_endpoint_connections_operations.py index f448f95a9b0f..8784e1b91a4a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +81,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +143,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -271,7 +276,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +335,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_private_link_resources_operations.py index 82365db54775..1d93607f67ea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_resolve_private_link_service_id_operations.py index 753a3b650d05..38e6e8928210 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_snapshots_operations.py index 320cd642f136..f53ff9b49e6f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +242,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +364,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +502,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +573,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/models/_models_py3.py index b4f0193b6765..1372c92d535d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/models/_models_py3.py @@ -1469,7 +1469,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1540,7 +1540,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4367,7 +4367,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4417,7 +4417,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_agent_pools_operations.py index 9aa0ba81dbdf..3c97f42ac98f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -353,7 +358,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -435,7 +440,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -804,7 +809,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -866,7 +871,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -912,7 +917,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_maintenance_configurations_operations.py index 9bed10683299..40e92082b38f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -239,7 +244,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_managed_clusters_operations.py index e938373490b3..f65928d3423c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -847,7 +852,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -907,7 +912,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -988,7 +993,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1067,7 +1072,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1116,7 +1121,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1131,7 +1136,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1193,7 +1198,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1265,7 +1270,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1328,7 +1333,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1386,7 +1391,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1436,7 +1441,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1633,7 +1638,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1822,7 +1827,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1921,7 +1926,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2103,7 +2108,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2279,7 +2284,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2377,7 +2382,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2476,7 +2481,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2576,7 +2581,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2789,7 +2794,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2861,7 +2866,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_operations.py index 0e12892a346b..4a923de0eb42 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_private_endpoint_connections_operations.py index d80d26968c97..1af7d01046b6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -312,7 +317,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -445,7 +450,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -504,7 +509,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_private_link_resources_operations.py index c41fbb3e8b6f..34d142b9c233 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_resolve_private_link_service_id_operations.py index 587dde4ce346..a8b6542d6005 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -176,7 +181,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_snapshots_operations.py index d4eff90c6472..fa2c49d79a29 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -281,7 +286,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -361,7 +366,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +443,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +565,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -769,7 +774,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_agent_pools_operations.py index 900bd3834da4..43a58988f080 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -224,7 +229,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -433,7 +438,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -617,7 +622,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_maintenance_configurations_operations.py index a02d9a2897d1..d4d0fdf3ec79 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,7 +385,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_managed_clusters_operations.py index 5966d057a194..47ecab635d29 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -159,7 +164,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -244,7 +249,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +328,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -374,7 +379,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -389,7 +394,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +468,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -528,7 +533,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +597,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -652,7 +657,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -704,7 +709,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -906,7 +911,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1208,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1389,7 +1394,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1570,7 +1575,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1672,7 +1677,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1775,7 +1780,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1879,7 +1884,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2097,7 +2102,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2173,7 +2178,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_operations.py index 3e8669c41df4..eb8cb6c11799 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_private_endpoint_connections_operations.py index e9be4ee1966e..342cedc41485 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -141,7 +146,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -277,7 +282,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +343,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_private_link_resources_operations.py index 6744e283639c..7cdf5430da89 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +73,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index cf0be64f692b..afb0fede76f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -132,7 +137,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_snapshots_operations.py index 91abe5aa15aa..bc38326b4592 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +169,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +246,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +370,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +511,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -579,7 +584,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/models/_models_py3.py index 452c67bc56b8..2a01363254fc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/models/_models_py3.py @@ -1525,7 +1525,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1596,7 +1596,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4577,7 +4577,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4629,7 +4629,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_agent_pools_operations.py index 386fdfe6000a..66a0a4cf6c36 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -356,7 +361,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +443,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +497,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -818,7 +823,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -882,7 +887,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -930,7 +935,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_maintenance_configurations_operations.py index 83855a1529e9..1d59e7af77dc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -241,7 +246,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +328,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -535,7 +540,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_managed_clusters_operations.py index 42ba9ed29a12..62466c5741bb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -847,7 +852,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -911,7 +916,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -994,7 +999,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1073,7 +1078,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1124,7 +1129,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1139,7 +1144,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1213,7 +1218,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1278,7 +1283,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1342,7 +1347,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1402,7 +1407,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1454,7 +1459,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1656,7 +1661,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1850,7 +1855,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1953,7 +1958,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2139,7 +2144,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2320,7 +2325,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2422,7 +2427,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2525,7 +2530,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2629,7 +2634,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2847,7 +2852,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2923,7 +2928,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_operations.py index 33017f4357ff..cb3d3b1207e7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_private_endpoint_connections_operations.py index 25a859a4fae6..bf95f0bf074e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -251,7 +256,7 @@ def list( ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -315,7 +320,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +517,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_private_link_resources_operations.py index 069838f86362..43805b8dc7f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -109,7 +114,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_resolve_private_link_service_id_operations.py index 213fe172fb35..cbf7ac55f78f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -176,7 +181,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_snapshots_operations.py index 55c466f7de13..491f56fdb3cd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -284,7 +289,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -367,7 +372,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +449,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +573,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -709,7 +714,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -782,7 +787,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_agent_pools_operations.py index 744b03432da1..482664f9a7da 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +434,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +615,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +661,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_maintenance_configurations_operations.py index 174286ab7b43..bcec68f25f26 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_managed_clusters_operations.py index d256c4b1db55..13af1199ae00 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +324,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -384,7 +389,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +452,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -520,7 +525,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +589,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +648,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +698,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +898,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1085,7 +1090,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1549,7 +1554,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1648,7 +1653,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1849,7 +1854,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2066,7 +2071,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2139,7 +2144,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_operations.py index 3e8fa6880e9b..17399efc5992 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_private_endpoint_connections_operations.py index 61d32f87f215..c0b7041f21f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_private_link_resources_operations.py index 456b3837767b..11b6ddeb459f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_resolve_private_link_service_id_operations.py index 377bc7751e2f..0f8c7a6f806b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_snapshots_operations.py index 53ac38e8557f..6b6c0f8f9148 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/models/_models_py3.py index de8d0b88e3a0..b1f7d41eefd8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/models/_models_py3.py @@ -1469,7 +1469,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1540,7 +1540,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4389,7 +4389,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4439,7 +4439,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_agent_pools_operations.py index 557d24748c0e..469f94a84dec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -368,7 +373,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +508,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +712,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +830,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -888,7 +893,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -934,7 +939,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_maintenance_configurations_operations.py index e6d3972857d8..9ac4606d3c72 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_managed_clusters_operations.py index 29b6d3d0fb7d..dd3046cb51bc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -883,7 +888,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -943,7 +948,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1025,7 +1030,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1110,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1154,7 +1159,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1170,7 +1175,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1306,7 +1311,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1429,7 +1434,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1484,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1679,7 +1684,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1871,7 +1876,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1971,7 +1976,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2156,7 +2161,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2335,7 +2340,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2434,7 +2439,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2534,7 +2539,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2635,7 +2640,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2852,7 +2857,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2925,7 +2930,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_operations.py index 8b5c8c4a1540..a1b51fe176b4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_private_endpoint_connections_operations.py index 59abf276fd05..b24c8959fcf8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_private_link_resources_operations.py index 2bc350a437bd..8c9915ce90f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_resolve_private_link_service_id_operations.py index 472a165bc6e7..b4a10c191e1e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_snapshots_operations.py index 8b729bf8e254..d10c9049cc0c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_agent_pools_operations.py index 68a7591eb090..fdb0b0ab5131 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -438,7 +443,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -560,7 +565,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -625,7 +630,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -673,7 +678,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_maintenance_configurations_operations.py index 1bf895cbfd5a..a6549dfcb60d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 513e6a79e6ed..a62cce61af23 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_managed_clusters_operations.py index 5397cc4c5ec9..6e739499564f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -159,7 +164,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +250,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -392,7 +397,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +462,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -532,7 +537,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +603,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -659,7 +664,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -711,7 +716,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -916,7 +921,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1113,7 +1118,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1217,7 +1222,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1406,7 +1411,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1590,7 +1595,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1693,7 +1698,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1797,7 +1802,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1902,7 +1907,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2124,7 +2129,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2201,7 +2206,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_operations.py index 05326c7d80f0..125a28230bff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_private_endpoint_connections_operations.py index ea4c388702cf..76c320dc7ddc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_private_link_resources_operations.py index 65077f6d7270..6b2b39468f1c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index c730e58617e8..0aaa77ac36a1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_snapshots_operations.py index 6a44473969b1..3b45164b0421 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/models/_models_py3.py index 01f192876249..d228af968066 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/models/_models_py3.py @@ -1560,7 +1560,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1631,7 +1631,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4820,7 +4820,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4872,7 +4872,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_agent_pools_operations.py index 5083634b6278..8c1d30fd1f76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -371,7 +376,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -454,7 +459,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +513,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -717,7 +722,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -839,7 +844,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -904,7 +909,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -952,7 +957,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_maintenance_configurations_operations.py index f0cab3eafcdf..3de3f183a859 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_managed_cluster_snapshots_operations.py index e2940ddb6a7c..caa5d3da5e75 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_managed_clusters_operations.py index 3252d1644960..3adde5571648 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -883,7 +888,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -947,7 +952,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1031,7 +1036,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1111,7 +1116,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1162,7 +1167,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1178,7 +1183,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1243,7 +1248,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1318,7 +1323,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1384,7 +1389,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1445,7 +1450,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1497,7 +1502,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1702,7 +1707,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1899,7 +1904,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2003,7 +2008,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2192,7 +2197,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2376,7 +2381,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2479,7 +2484,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2583,7 +2588,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2688,7 +2693,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2910,7 +2915,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2987,7 +2992,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_operations.py index a442bc376c64..9f1e6e3fd8de 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_private_endpoint_connections_operations.py index 6483084437ae..00ed8922147e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_private_link_resources_operations.py index 0d18eb8f652d..41ed3300a92b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_resolve_private_link_service_id_operations.py index 38a7819cd984..3b437e2739d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_snapshots_operations.py index 86c909501036..9b54703ac2f4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_agent_pools_operations.py index 3692a34f161f..102fc96125d8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +434,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +615,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +661,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_maintenance_configurations_operations.py index 821cf9beb1a1..1faff7856c76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_managed_clusters_operations.py index cdaa19a5c7db..e5acdcbd2026 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +324,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -384,7 +389,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +452,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -520,7 +525,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +589,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +648,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +698,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +898,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1085,7 +1090,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1549,7 +1554,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1648,7 +1653,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1849,7 +1854,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2066,7 +2071,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2139,7 +2144,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_operations.py index 3527a9c03be7..7065fa265c56 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_private_endpoint_connections_operations.py index 340c933cad24..63fe8b4db3fd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_private_link_resources_operations.py index 096faceac92b..61f2b8c86935 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_resolve_private_link_service_id_operations.py index 9800e7d81eae..8dc0a504a374 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_snapshots_operations.py index 702dc1982e9a..a9d062a7f524 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/models/_models_py3.py index ac5c63d9429a..fb143e238147 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/models/_models_py3.py @@ -1469,7 +1469,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1540,7 +1540,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4532,7 +4532,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4582,7 +4582,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_agent_pools_operations.py index 5a7fd6b7242f..01465bfb5c6b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -368,7 +373,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +508,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +712,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +830,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -888,7 +893,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -934,7 +939,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_maintenance_configurations_operations.py index 751b281a6fe8..786a90990e4f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_managed_clusters_operations.py index 188cec9c207e..56d0571eee7c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -883,7 +888,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -943,7 +948,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1025,7 +1030,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1110,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1154,7 +1159,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1170,7 +1175,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1306,7 +1311,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1429,7 +1434,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1484,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1679,7 +1684,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1871,7 +1876,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1971,7 +1976,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2156,7 +2161,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2335,7 +2340,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2434,7 +2439,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2534,7 +2539,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2635,7 +2640,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2852,7 +2857,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2925,7 +2930,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_operations.py index 8f2a30329747..27b4ec89e7db 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_private_endpoint_connections_operations.py index 2837ffe2e96a..3eb099080594 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_private_link_resources_operations.py index dd9d3fecda23..fbd5494cce78 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_resolve_private_link_service_id_operations.py index 79224e0cd5d8..90f34bbf0eb8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_snapshots_operations.py index b2857e39d06c..8411fb32b231 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_agent_pools_operations.py index 97dda11ec7ca..b703994cc538 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -640,7 +645,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_maintenance_configurations_operations.py index a2510621e0c5..3aa20fa1b23d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index bd0e16f191d1..3ac4f635ddc7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_managed_clusters_operations.py index 636f741f4fdf..7569df8857c5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,6 +56,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +251,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +331,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -393,7 +398,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -533,7 +538,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -599,7 +604,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -660,7 +665,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +717,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +922,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1118,7 +1123,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1606,7 +1611,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1709,7 +1714,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1811,7 +1816,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2020,7 +2025,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2242,7 +2247,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2319,7 +2324,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_operations.py index d287f7d1bdf6..5e793ae3a9e4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_private_endpoint_connections_operations.py index ff869ca0903b..02166c5b60f5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_private_link_resources_operations.py index e850a0f71534..5a7cb8e56150 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 66acc1a40cf2..7a1a5562537b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_snapshots_operations.py index bff185a2a9d6..d2b719f67bb7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/models/_models_py3.py index 32031882bab5..904faaf341cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/models/_models_py3.py @@ -1577,7 +1577,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1648,7 +1648,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5134,7 +5134,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5186,7 +5186,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_agent_pools_operations.py index 17182422c83e..0dc848dcd203 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -381,7 +386,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -518,7 +523,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -732,7 +737,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +869,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -929,7 +934,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -977,7 +982,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_maintenance_configurations_operations.py index 690d297e06d6..919b9dfde560 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_managed_cluster_snapshots_operations.py index c40dd605dd37..bade365556cd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_managed_clusters_operations.py index 1703014b81d5..b7bbe76b34d4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -932,7 +937,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -996,7 +1001,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1080,7 +1085,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1211,7 +1216,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1227,7 +1232,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1292,7 +1297,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1367,7 +1372,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1438,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1499,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1546,7 +1551,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1751,7 +1756,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1952,7 +1957,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2067,7 +2072,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2256,7 +2261,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2440,7 +2445,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2543,7 +2548,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2645,7 +2650,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2749,7 +2754,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2854,7 +2859,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3076,7 +3081,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3153,7 +3158,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_operations.py index fedc172a8796..c5a7645fd9b8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_private_endpoint_connections_operations.py index 87edd3857557..372cfe3ebc8d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_private_link_resources_operations.py index ffe566d8d7ff..97cf104acafd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_resolve_private_link_service_id_operations.py index 52c498741908..af30b0b9759f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_snapshots_operations.py index 502bebe2a638..3126fd637401 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_agent_pools_operations.py index 488d41d6bfa1..559b28a685ec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +434,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +615,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +661,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_maintenance_configurations_operations.py index 99d336fe0a60..ab00cd4745f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_managed_clusters_operations.py index 8d853539d084..1c60c37ef0d8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +324,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -384,7 +389,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +452,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -520,7 +525,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +589,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +648,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +698,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +898,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1085,7 +1090,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1549,7 +1554,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1648,7 +1653,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1849,7 +1854,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2066,7 +2071,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2139,7 +2144,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_operations.py index 91bace098ab2..cf4a4628a840 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_private_endpoint_connections_operations.py index 44504cce94b5..a1e9da9d4a48 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_private_link_resources_operations.py index cebaf79566d2..4f4a9ad8c28e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_resolve_private_link_service_id_operations.py index c308ef2c24bc..458d3d29efc1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_snapshots_operations.py index 3f05efd3feac..64fc2d051429 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/models/_models_py3.py index 7f2147eed79d..4bae9a958a51 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/models/_models_py3.py @@ -1484,7 +1484,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1555,7 +1555,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4600,7 +4600,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4650,7 +4650,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_agent_pools_operations.py index c7a71cb6479a..5061637d153b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -368,7 +373,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +508,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +712,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +830,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -888,7 +893,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -934,7 +939,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_maintenance_configurations_operations.py index e0e41c39c7ee..3b73839863e1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_managed_clusters_operations.py index 05efaff3d7b4..83f394b903c3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -883,7 +888,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -943,7 +948,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1025,7 +1030,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1110,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1154,7 +1159,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1170,7 +1175,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1306,7 +1311,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1429,7 +1434,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1484,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1679,7 +1684,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1871,7 +1876,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1971,7 +1976,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2156,7 +2161,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2335,7 +2340,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2434,7 +2439,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2534,7 +2539,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2635,7 +2640,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2852,7 +2857,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2925,7 +2930,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_operations.py index dff51f3e9da6..c74e74c0bed8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_private_endpoint_connections_operations.py index 055ed648c2ca..cfdaaf66e977 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_private_link_resources_operations.py index 10c588ff50c7..7d5a1da8bf16 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_resolve_private_link_service_id_operations.py index bfff1f4a1357..55c8d2bc47c1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_snapshots_operations.py index 530e8326bf1c..c3c82ad29a21 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-04-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_agent_pools_operations.py index 78c5410813df..cfa580db94df 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -640,7 +645,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_maintenance_configurations_operations.py index 82c97fd63c9c..e405d611caef 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index e7e164ecaad4..3044ddcbe23d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_managed_clusters_operations.py index 59795f24cb60..78e24c3b176e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,6 +56,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +251,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +331,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -393,7 +398,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -533,7 +538,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -599,7 +604,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -660,7 +665,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +717,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +922,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1118,7 +1123,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1606,7 +1611,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1709,7 +1714,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1811,7 +1816,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2020,7 +2025,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2242,7 +2247,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2319,7 +2324,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_operations.py index 4d4f2d9be765..953e21a999d0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_private_endpoint_connections_operations.py index d90b284da7e5..ddd44490229f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_private_link_resources_operations.py index c657b35e182c..a05e8c25aba3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index d5c4b53973d8..532c9aef0572 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_snapshots_operations.py index fb96440dfe31..ae8dc8e3dd87 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 63f2863a5e18..c0893f869540 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_trusted_access_roles_operations.py index 1b5e47a85a04..140b7f04c662 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/models/_models_py3.py index ce499ef0204c..f15b5fc8c5ad 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/models/_models_py3.py @@ -1603,7 +1603,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1674,7 +1674,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5217,7 +5217,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5269,7 +5269,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_agent_pools_operations.py index d9e5668cc5e8..fb561aa23921 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -381,7 +386,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -518,7 +523,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -732,7 +737,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +869,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -929,7 +934,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -977,7 +982,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_maintenance_configurations_operations.py index b5a746f2b356..ef8f16460b1c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_managed_cluster_snapshots_operations.py index cd72e2e4a766..f2a737232c45 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_managed_clusters_operations.py index dd5334db05c7..37e185b1a1c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -932,7 +937,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -996,7 +1001,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1080,7 +1085,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1211,7 +1216,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1227,7 +1232,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1292,7 +1297,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1367,7 +1372,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1438,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1499,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1546,7 +1551,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1751,7 +1756,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1952,7 +1957,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2067,7 +2072,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2256,7 +2261,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2440,7 +2445,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2543,7 +2548,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2645,7 +2650,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2749,7 +2754,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2854,7 +2859,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3076,7 +3081,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3153,7 +3158,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_operations.py index c10bc2896b2d..227c507ba41f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_private_endpoint_connections_operations.py index 57b4e36df1fa..2c43124d2e01 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_private_link_resources_operations.py index 2978fdc1fb03..7f9fdc8bb10b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_resolve_private_link_service_id_operations.py index 03b7983f7893..af2b861a243d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_snapshots_operations.py index 0563c4ad86cc..3120da03d4a4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_trusted_access_role_bindings_operations.py index bac1eea8f92f..bea922cdf3b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -268,7 +273,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_trusted_access_roles_operations.py index 36aa07fef3f2..92a83567c5be 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_agent_pools_operations.py index 608e322ad736..d2a74e143671 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -640,7 +645,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_maintenance_configurations_operations.py index ffd5b44fb6b9..67606cf2b7c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index f4e0bca01b84..84b701ee30be 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_managed_clusters_operations.py index 4f35f2aa23dd..d2560b7a586f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,6 +56,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +251,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +331,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -393,7 +398,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -533,7 +538,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -599,7 +604,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -660,7 +665,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +717,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +922,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1118,7 +1123,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1606,7 +1611,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1709,7 +1714,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1811,7 +1816,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2020,7 +2025,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2242,7 +2247,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2319,7 +2324,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_operations.py index 1e34d7bd4386..832893d69fb3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_private_endpoint_connections_operations.py index d7194e593f10..8c43adedef5a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_private_link_resources_operations.py index 0d1b79326915..b1596fbaa9ac 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 444785d77a4b..be851743d35f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_snapshots_operations.py index 8f068a8e0673..eb0075d3ef1d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 647173a3db69..5e98ebe184d4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_trusted_access_roles_operations.py index f42727988233..e77da12ff4ed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/models/_models_py3.py index a782dc60e0c6..419ab2760310 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/models/_models_py3.py @@ -806,8 +806,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_05_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -844,8 +844,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_05_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1631,7 +1631,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1702,7 +1702,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5308,7 +5308,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5360,7 +5360,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_agent_pools_operations.py index cbc3608fb2fe..ac14630e4b0d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -381,7 +386,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -518,7 +523,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -732,7 +737,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +869,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -929,7 +934,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -977,7 +982,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_maintenance_configurations_operations.py index 8bd4d2c4abe0..ecc5da2348cf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_managed_cluster_snapshots_operations.py index 7dc08ac1ca25..0f6bb4e520bb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_managed_clusters_operations.py index a3ceefbff45d..2e1b1bb67646 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -932,7 +937,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -996,7 +1001,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1080,7 +1085,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1211,7 +1216,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1227,7 +1232,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1292,7 +1297,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1367,7 +1372,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1438,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1499,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1546,7 +1551,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1751,7 +1756,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1952,7 +1957,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2067,7 +2072,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2256,7 +2261,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2440,7 +2445,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2543,7 +2548,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2645,7 +2650,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2749,7 +2754,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2854,7 +2859,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3076,7 +3081,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3153,7 +3158,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_operations.py index 3764294571a2..35243cd69dbc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_private_endpoint_connections_operations.py index f609176d2374..066b1779064a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_private_link_resources_operations.py index e0b90d6636e4..a024a5d20056 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_resolve_private_link_service_id_operations.py index c3ceb463bd83..6ab915db8ca8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_snapshots_operations.py index ab2fd8db1aec..5444e3a70fcc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_trusted_access_role_bindings_operations.py index 11fbf33e9330..49378347ca4f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -268,7 +273,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_trusted_access_roles_operations.py index 1509497fefb0..595b558d14f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_agent_pools_operations.py index c46aa37d6f4c..187c5025e5f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +434,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +615,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +661,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_maintenance_configurations_operations.py index 3b00299a0949..8f47399221da 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_managed_clusters_operations.py index f7cad10d31a9..8ba5a3ee20ee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +324,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -384,7 +389,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +452,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -520,7 +525,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +589,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +648,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +698,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +898,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1085,7 +1090,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1549,7 +1554,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1648,7 +1653,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1849,7 +1854,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2066,7 +2071,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2139,7 +2144,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_operations.py index 4e6c02fff225..50b57029ef8f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_private_endpoint_connections_operations.py index 017c3543f6bf..0b0ff08430d4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_private_link_resources_operations.py index 1d2d144e3ce9..4aea7b62f6cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_resolve_private_link_service_id_operations.py index 34cd26c853b3..3caa7043fcfe 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_snapshots_operations.py index 7ad5d74b2235..b5a1a440d9c8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/models/_models_py3.py index 9fe142251874..677848a0dfb5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/models/_models_py3.py @@ -766,8 +766,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_06_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -804,8 +804,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_06_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1564,7 +1564,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1635,7 +1635,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4750,7 +4750,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4800,7 +4800,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_agent_pools_operations.py index 32a44779d519..83c76920b7a7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -368,7 +373,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +508,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +712,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +830,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -888,7 +893,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -934,7 +939,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_maintenance_configurations_operations.py index 210bf459452a..cacd4e11ab7b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_managed_clusters_operations.py index 3ab2f2383d74..8b4e157e72c1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -883,7 +888,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -943,7 +948,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1025,7 +1030,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1110,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1154,7 +1159,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1170,7 +1175,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1306,7 +1311,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1429,7 +1434,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1484,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1679,7 +1684,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1871,7 +1876,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1971,7 +1976,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2156,7 +2161,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2335,7 +2340,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2434,7 +2439,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2534,7 +2539,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2635,7 +2640,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2852,7 +2857,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2925,7 +2930,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_operations.py index f5239415d024..e0f15d286457 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_private_endpoint_connections_operations.py index 058e2acf5c45..9aec14c22e2e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_private_link_resources_operations.py index 3445065e4323..d02287dae6b1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_resolve_private_link_service_id_operations.py index 079cf81df5b7..11823f81b65b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_snapshots_operations.py index de39047e8216..43a13383f697 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-06-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_agent_pools_operations.py index 3b7f35b9cffc..6fc06400ec47 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -443,7 +448,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -640,7 +645,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_fleet_members_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_fleet_members_operations.py index e1227a6c0c6a..ce021f85a2c8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_fleet_members_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_fleet_members_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_by_fleet_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ async def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.FleetMember: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +343,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.FleetMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -537,7 +542,7 @@ def list_by_fleet( ) cls: ClsType[_models.FleetMembersListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_fleets_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_fleets_operations.py index 0fb0fe7be025..8d357242783c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_fleets_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_fleets_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ async def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.Fleet: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -401,7 +406,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +532,7 @@ async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -657,7 +662,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -740,7 +745,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -820,7 +825,7 @@ async def list_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.FleetCredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_maintenance_configurations_operations.py index b6d895540b75..a661bd04e309 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index ac80ff22decb..6d3b3deaa66f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_managed_clusters_operations.py index db8ee20fc2d2..0c09165381b8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,6 +56,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +251,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -326,7 +331,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -393,7 +398,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -533,7 +538,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -599,7 +604,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -660,7 +665,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -712,7 +717,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -917,7 +922,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1118,7 +1123,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1422,7 +1427,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1606,7 +1611,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1709,7 +1714,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1811,7 +1816,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2020,7 +2025,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2242,7 +2247,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2319,7 +2324,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_operations.py index 26e886bf5cb7..21ac433439ea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_private_endpoint_connections_operations.py index 5f670bba02e7..bf19b1fdd0bd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_private_link_resources_operations.py index 1df4906c7de0..8893ece7f15b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 670f89b8f45a..9123d1aebc1e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_snapshots_operations.py index 25e9846c4b09..1f9fb9dff6ee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 9848286cf578..68dc8b0e7a66 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_trusted_access_roles_operations.py index cccbc55d0ce8..fbe6b55738f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/models/_models_py3.py index 222422e38e45..9eccf63ee306 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/models/_models_py3.py @@ -889,8 +889,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_06_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -927,8 +927,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_06_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2163,7 +2163,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2234,7 +2234,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5778,7 +5778,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5830,7 +5830,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_agent_pools_operations.py index 33551320c077..014e3456319c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -381,7 +386,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -518,7 +523,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -732,7 +737,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -864,7 +869,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -929,7 +934,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -977,7 +982,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_fleet_members_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_fleet_members_operations.py index fadcabf98a2c..9b57e1fb6cae 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_fleet_members_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_fleet_members_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -255,7 +260,7 @@ def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.FleetMember: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.FleetMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +581,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -720,7 +725,7 @@ def list_by_fleet( ) cls: ClsType[_models.FleetMembersListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_fleets_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_fleets_operations.py index 274a03bab578..a620ff5f1876 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_fleets_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_fleets_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.Fleet: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +724,7 @@ def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -768,7 +773,7 @@ def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _mode def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Fleet"]: ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1066,7 @@ def list_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.FleetCredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_maintenance_configurations_operations.py index 9f1b9a1d2df5..fe6de130ef21 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_managed_cluster_snapshots_operations.py index 5c8449f0fc89..88f7d26af4ce 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_managed_clusters_operations.py index c2d69f753ac3..32b2a5e021c3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -932,7 +937,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -996,7 +1001,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1080,7 +1085,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1160,7 +1165,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1211,7 +1216,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1227,7 +1232,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1292,7 +1297,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1367,7 +1372,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1438,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1494,7 +1499,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1546,7 +1551,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1751,7 +1756,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1952,7 +1957,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2067,7 +2072,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2256,7 +2261,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2440,7 +2445,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2543,7 +2548,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2645,7 +2650,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2749,7 +2754,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2854,7 +2859,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3076,7 +3081,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3153,7 +3158,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_operations.py index 15038fca5274..1f09009c9a70 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_private_endpoint_connections_operations.py index 29f209ea87a0..137ccfdf22fd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_private_link_resources_operations.py index fcfbb619317a..466ab11a0b5b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_resolve_private_link_service_id_operations.py index 782b91e07154..06c0323be199 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_snapshots_operations.py index 19a145c94cd7..11bcfb49258e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_trusted_access_role_bindings_operations.py index 3d95d8eb0ab2..c159d7403846 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -268,7 +273,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_trusted_access_roles_operations.py index 0ccf801600e3..df2e981bb6d6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_agent_pools_operations.py index 0d2125307976..990ca0e23e61 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +434,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +615,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +661,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_maintenance_configurations_operations.py index 415066892a22..efc8cf7d6f8f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_managed_clusters_operations.py index 69712bd0a4de..7508fabe2ca1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,6 +55,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,7 +100,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -319,7 +324,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -384,7 +389,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -447,7 +452,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -520,7 +525,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -584,7 +589,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -643,7 +648,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -693,7 +698,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -893,7 +898,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1085,7 +1090,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1549,7 +1554,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1648,7 +1653,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1849,7 +1854,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2066,7 +2071,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2139,7 +2144,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_operations.py index 9de9079957ef..8ad3e8f37de8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_private_endpoint_connections_operations.py index bc9a7e0c5d75..5358f5911c2e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_private_link_resources_operations.py index 4d06365958bc..88cb7f94130f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_resolve_private_link_service_id_operations.py index cb8bbca8026f..b4769d5348cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_snapshots_operations.py index 0d9e5d90e06c..7a034c51e8fd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/models/_models_py3.py index da8c6b886eee..f3b6bda07fc6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/models/_models_py3.py @@ -770,8 +770,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_07_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -808,8 +808,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_07_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1568,7 +1568,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1639,7 +1639,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4762,7 +4762,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4812,7 +4812,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_agent_pools_operations.py index 1bdab67f8598..5b86997e5754 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -368,7 +373,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +508,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +712,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +830,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -888,7 +893,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -934,7 +939,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_maintenance_configurations_operations.py index 733b0e816cb6..e197983b51ad 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_managed_clusters_operations.py index bc51867033f0..f3bafb7ef7c2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -883,7 +888,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -943,7 +948,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1025,7 +1030,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1110,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1154,7 +1159,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1170,7 +1175,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1233,7 +1238,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1306,7 +1311,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1370,7 +1375,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1429,7 +1434,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1484,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1679,7 +1684,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1871,7 +1876,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1971,7 +1976,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2156,7 +2161,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2335,7 +2340,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2434,7 +2439,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2534,7 +2539,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2635,7 +2640,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2852,7 +2857,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2925,7 +2930,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_operations.py index 378df34b899b..ea8676e28d4e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_private_endpoint_connections_operations.py index ed00602e690f..95d3d16a413b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_private_link_resources_operations.py index ae09d563dc2b..5b7cedfbccdd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_resolve_private_link_service_id_operations.py index ee641ae2f36e..ce1e158deb71 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_snapshots_operations.py index 75eabb25a339..d67c5d30dae7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-07-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_agent_pools_operations.py index d98b23921098..3413ef19e700 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +297,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +646,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +711,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -754,7 +759,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_fleet_members_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_fleet_members_operations.py index 91833a0bd0c8..516d3a7eb756 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_fleet_members_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_fleet_members_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_by_fleet_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ async def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.FleetMember: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +343,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.FleetMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +398,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -537,7 +542,7 @@ def list_by_fleet( ) cls: ClsType[_models.FleetMembersListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_fleets_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_fleets_operations.py index 784a7383f39e..394ed56ddb5e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_fleets_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_fleets_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ async def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.Fleet: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -401,7 +406,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -478,7 +483,7 @@ async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +532,7 @@ async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -657,7 +662,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -740,7 +745,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -820,7 +825,7 @@ async def list_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.FleetCredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_maintenance_configurations_operations.py index 3bfe619fd5d3..51997117a139 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 84035241953e..29dcc0cefe03 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_managed_clusters_operations.py index ae351f4d4bef..1db053fb9596 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -394,7 +399,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +666,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +923,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1124,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1234,7 +1239,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1427,7 +1432,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1633,7 +1638,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1677,7 +1682,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1784,7 +1789,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1890,7 +1895,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1998,7 +2003,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2107,7 +2112,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2333,7 +2338,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2410,7 +2415,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_operations.py index bb978410cb23..1f2facf427ee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_private_endpoint_connections_operations.py index 5b48ad32c7cc..6fee9732b603 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_private_link_resources_operations.py index e97465241b4b..b0ea29052dc0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index ee4759f23ef2..ee8eafc76dc3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_snapshots_operations.py index 0e54377e576b..67a16c788cff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 4967a507a3b9..b96a4a452d76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_trusted_access_roles_operations.py index 11679b1a5b1d..b1b7c93d45e0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_models_py3.py index 1ea24b73e98a..590d2ae34c43 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_models_py3.py @@ -889,8 +889,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_07_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -927,8 +927,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_07_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2163,7 +2163,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2234,7 +2234,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5925,7 +5925,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5977,7 +5977,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_agent_pools_operations.py index 33fbcae87430..f06501125598 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -421,7 +426,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,7 +575,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -624,7 +629,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -838,7 +843,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -970,7 +975,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1035,7 +1040,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1083,7 +1088,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_fleet_members_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_fleet_members_operations.py index 7ffd55076246..35d281327a9a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_fleet_members_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_fleet_members_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -255,7 +260,7 @@ def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.FleetMember: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.FleetMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -576,7 +581,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -720,7 +725,7 @@ def list_by_fleet( ) cls: ClsType[_models.FleetMembersListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_fleets_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_fleets_operations.py index 0df51daadf20..317682de4fcc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_fleets_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_fleets_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -315,7 +320,7 @@ def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.Fleet: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +724,7 @@ def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -768,7 +773,7 @@ def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _mode def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -981,7 +986,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Fleet"]: ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1061,7 +1066,7 @@ def list_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.FleetCredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_maintenance_configurations_operations.py index 2db4dd939946..697c9a016f9c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_managed_cluster_snapshots_operations.py index 06b1dc1a36c8..32dc50fc99b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_managed_clusters_operations.py index 61317d1d4869..be3f34f16f4e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -972,7 +977,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1036,7 +1041,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1125,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1267,7 +1272,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1412,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1539,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1591,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1796,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1997,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2107,7 +2112,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2300,7 +2305,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2506,7 +2511,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2550,7 +2555,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2657,7 +2662,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2763,7 +2768,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2871,7 +2876,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2980,7 +2985,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3206,7 +3211,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3283,7 +3288,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_operations.py index 132a783c292b..8a63790d78b4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_private_endpoint_connections_operations.py index 9ef09c74e07a..9dde91eedb19 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_private_link_resources_operations.py index caf8454f3079..c8c1ccb4a588 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_resolve_private_link_service_id_operations.py index 93fbb1e0f52c..42208ba63ad2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_snapshots_operations.py index 6e14210797d5..69cf471a2ac4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_trusted_access_role_bindings_operations.py index 356661225e62..97cdabcb527a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -268,7 +273,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_trusted_access_roles_operations.py index 16e3f3fa906a..cb18944520ff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_agent_pools_operations.py index cf7833db68c6..84be47011eba 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +297,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +646,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +711,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -754,7 +759,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_maintenance_configurations_operations.py index f1eaddb59331..bfc16a1a82ed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 66fa7260972a..0af1a995f6bf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_clusters_operations.py index 0366f0a46877..0b1e2649d325 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -394,7 +399,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +666,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +923,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1124,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1234,7 +1239,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1423,7 +1428,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1669,7 +1674,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1772,7 +1777,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1874,7 +1879,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1978,7 +1983,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2083,7 +2088,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2305,7 +2310,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2382,7 +2387,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_operations.py index afe1bc929234..68c3570440d0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_endpoint_connections_operations.py index 81cbee247127..a029a5b178ef 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_link_resources_operations.py index a3b39f66810d..80b2aceab645 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 4959ac74a98d..3203ea899fdd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_snapshots_operations.py index 5362d23acba0..bba42fbc0070 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 5f22c6bd8990..57586c385d19 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_roles_operations.py index 1aa01379a9d5..4a24efaa06b2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_models_py3.py index a92d5acd3e0d..1f5e2e19fd4b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_models_py3.py @@ -839,8 +839,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_08_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -877,8 +877,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_08_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1848,7 +1848,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1919,7 +1919,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5745,7 +5745,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5797,7 +5797,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_agent_pools_operations.py index 5191241b5633..0d0ec09ef818 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -421,7 +426,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,7 +575,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -624,7 +629,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -838,7 +843,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -970,7 +975,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1035,7 +1040,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1083,7 +1088,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_maintenance_configurations_operations.py index 88a22c295755..8f9f0b8e1033 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_cluster_snapshots_operations.py index 8a2dc9743b18..bd34ed313cf6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_clusters_operations.py index 4921af92b85c..30cf3c9b7c3c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -972,7 +977,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1036,7 +1041,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1125,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1267,7 +1272,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1412,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1539,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1591,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1796,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1997,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2107,7 +2112,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2296,7 +2301,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2498,7 +2503,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2542,7 +2547,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2645,7 +2650,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2747,7 +2752,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2851,7 +2856,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2956,7 +2961,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3178,7 +3183,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3255,7 +3260,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_operations.py index d5ca228e956a..7331414f1d5e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_endpoint_connections_operations.py index 9714b71af8a5..8efeb486c4cf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_link_resources_operations.py index f5e2f16d84de..b78225d75880 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_resolve_private_link_service_id_operations.py index 4f8c6e9c31ab..161ad6346524 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_snapshots_operations.py index 78707ab591e3..7422936d5ab0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_role_bindings_operations.py index 3379cb10e75c..7e347e15dbdd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -268,7 +273,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_roles_operations.py index c8d6cb1144f7..bc696ac53b8d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_agent_pools_operations.py index 023baafea5f9..c78e46123977 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +297,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +646,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +711,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -754,7 +759,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_maintenance_configurations_operations.py index 335b0923bdcb..17a48f522a02 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_managed_cluster_snapshots_operations.py index d45ce01493f9..5aa14fcac562 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_managed_clusters_operations.py index c0732ab59a76..66175a7e2d18 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -394,7 +399,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +666,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +923,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1124,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1234,7 +1239,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1423,7 +1428,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1669,7 +1674,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1772,7 +1777,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1874,7 +1879,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1978,7 +1983,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2083,7 +2088,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2305,7 +2310,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2382,7 +2387,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_operations.py index cd453d9d92a6..a88f0ab1a543 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_private_endpoint_connections_operations.py index 0890b52b9c63..dd2e1c6c8da5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_private_link_resources_operations.py index fe49a99103d4..e960bcf67773 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_resolve_private_link_service_id_operations.py index 90e4349b72cc..16a86c108e2c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_snapshots_operations.py index 1a9ab6239159..004eac4acf82 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_trusted_access_role_bindings_operations.py index e3df031199c9..f8ed6c6fad9f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_trusted_access_roles_operations.py index 7b053c07bfcc..933bff6e0e38 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/models/_models_py3.py index d85b0c484fd3..a6f654288fde 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/models/_models_py3.py @@ -870,8 +870,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_08_03_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -908,8 +908,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_08_03_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1905,7 +1905,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1976,7 +1976,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5820,7 +5820,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5872,7 +5872,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_agent_pools_operations.py index 2fe1aeeacfe4..859d0da434dc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -421,7 +426,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,7 +575,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -624,7 +629,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -838,7 +843,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -970,7 +975,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1035,7 +1040,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1083,7 +1088,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_maintenance_configurations_operations.py index d3421c5beaa5..e8b00b8a38e7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_managed_cluster_snapshots_operations.py index 99722b8b53fe..bd2f28c9b82c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_managed_clusters_operations.py index 59fbc2e993bc..5d5be7d2d20b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -972,7 +977,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1036,7 +1041,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1125,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1267,7 +1272,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1412,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1539,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1591,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1796,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1997,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2107,7 +2112,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2296,7 +2301,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2498,7 +2503,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2542,7 +2547,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2645,7 +2650,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2747,7 +2752,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2851,7 +2856,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2956,7 +2961,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3178,7 +3183,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3255,7 +3260,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_operations.py index 833fc3ab0386..546dec9809cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_private_endpoint_connections_operations.py index b42a21cc0db0..709eeafb4943 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_private_link_resources_operations.py index a01d17f0b9e6..2664fd15aa0f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_resolve_private_link_service_id_operations.py index 9cc947145d03..b6c47beb5821 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_snapshots_operations.py index d9975776685e..7c9b2b41cbcf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_trusted_access_role_bindings_operations.py index 3216dd6551b3..06a01cc78301 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -268,7 +273,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_08_03_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_trusted_access_roles_operations.py index 0ebc52029d9d..3cb948ebdc27 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_03_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_agent_pools_operations.py index 07f79401bb7d..62f8c85dddfd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +434,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +615,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -656,7 +661,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_maintenance_configurations_operations.py index 1d3438b3d5b2..b4ebfe52d3ae 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_managed_clusters_operations.py index 826e20e54ec0..5b12d84761b1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,6 +56,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -240,7 +245,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +325,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +374,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -385,7 +390,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +453,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -585,7 +590,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -644,7 +649,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -694,7 +699,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -894,7 +899,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1086,7 +1091,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1186,7 +1191,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1371,7 +1376,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1550,7 +1555,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1649,7 +1654,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1753,7 +1758,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1853,7 +1858,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1954,7 +1959,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2171,7 +2176,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2244,7 +2249,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_operations.py index 60896403eb42..cc8f6c782a50 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_private_endpoint_connections_operations.py index dd189ef95dd7..9ef4378a4ce2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_private_link_resources_operations.py index 50043d0a2884..e3e09392afcd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_resolve_private_link_service_id_operations.py index 35a338664635..64abd28d6a4d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_snapshots_operations.py index 8527b9b54d27..74c6e877543b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/models/_models_py3.py index 527ff4942649..672152449c2c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/models/_models_py3.py @@ -770,8 +770,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_09_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -808,8 +808,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_09_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1568,7 +1568,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1639,7 +1639,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4830,7 +4830,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4880,7 +4880,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_agent_pools_operations.py index aa6c0a150d29..77e4fd8b8d16 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -368,7 +373,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +456,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -503,7 +508,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -707,7 +712,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -825,7 +830,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -888,7 +893,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -934,7 +939,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_maintenance_configurations_operations.py index 3813f16d99ba..77ab4f50ce5b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_managed_clusters_operations.py index 0ee6e65f7d4f..628d861c24f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -923,7 +928,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -983,7 +988,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1065,7 +1070,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1145,7 +1150,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1194,7 +1199,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1210,7 +1215,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1273,7 +1278,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1346,7 +1351,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1410,7 +1415,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1474,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1519,7 +1524,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1719,7 +1724,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1911,7 +1916,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2011,7 +2016,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2196,7 +2201,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2375,7 +2380,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2474,7 +2479,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2578,7 +2583,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2678,7 +2683,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2779,7 +2784,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2996,7 +3001,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3069,7 +3074,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_operations.py index ff8b62116a9e..be98c60c5cad 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_private_endpoint_connections_operations.py index 67df02dd06f7..710d1e23c553 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_private_link_resources_operations.py index 0a8e4edec9d5..654c889be061 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_resolve_private_link_service_id_operations.py index 8222ae7f9ae1..a7642429c771 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_snapshots_operations.py index a28b3de61612..89f59c95de58 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_agent_pools_operations.py index a92182971aed..194227078f19 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -155,7 +160,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -238,7 +243,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -292,7 +297,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -641,7 +646,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -706,7 +711,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -754,7 +759,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_fleet_members_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_fleet_members_operations.py index 069f0b962245..5f365a5dcc37 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_fleet_members_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_fleet_members_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_by_fleet_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,7 +93,7 @@ def list_by_fleet( ) cls: ClsType[_models.FleetMembersListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.FleetMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +234,7 @@ async def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.FleetMember: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_fleets_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_fleets_operations.py index 473df157309b..c18be5942e40 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_fleets_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_fleets_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -248,7 +253,7 @@ async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +308,7 @@ async def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.Fleet: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -633,7 +638,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -827,7 +832,7 @@ async def list_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.FleetCredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_maintenance_configurations_operations.py index bcb46b0a69e9..7a6b6a981921 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 2733239186e8..f4d2fa3e696f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_managed_clusters_operations.py index 3314220cf74b..8f806981b61e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -394,7 +399,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +666,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +923,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1124,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1234,7 +1239,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1423,7 +1428,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1669,7 +1674,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1772,7 +1777,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1874,7 +1879,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1978,7 +1983,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2083,7 +2088,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2305,7 +2310,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2382,7 +2387,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_operations.py index 7521598dd192..3b24689158d0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_private_endpoint_connections_operations.py index b62d6ea6b353..54bbf86aac9c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_private_link_resources_operations.py index 410c604d17ba..43632faff66f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index cada9cec5995..613f611ac544 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_snapshots_operations.py index 32194f908df9..2d5bf1c37b09 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 4ebe9e0f55f3..321a77030dea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_trusted_access_roles_operations.py index ec12b2669218..72ef424bf5b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/models/_models_py3.py index 7dddd7392eb5..93fa5a459bfa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/models/_models_py3.py @@ -980,8 +980,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_09_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -1018,8 +1018,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_09_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2478,7 +2478,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2549,7 +2549,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6319,7 +6319,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6371,7 +6371,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_agent_pools_operations.py index 626d322fabe8..c02620ce9c8f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -421,7 +426,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -487,7 +492,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -570,7 +575,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -624,7 +629,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -838,7 +843,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -970,7 +975,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1035,7 +1040,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1083,7 +1088,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_fleet_members_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_fleet_members_operations.py index 5e4339ed1b07..65cb61ce1e59 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_fleet_members_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_fleet_members_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -271,7 +276,7 @@ def list_by_fleet( ) cls: ClsType[_models.FleetMembersListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +360,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.FleetMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +417,7 @@ def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.FleetMember: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +674,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_fleets_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_fleets_operations.py index c463ab9aca77..3dc56d6c6a18 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_fleets_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_fleets_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -325,7 +330,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Fleet"]: ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -410,7 +415,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.FleetListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -489,7 +494,7 @@ def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _mode :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +549,7 @@ def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.Fleet: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +878,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -938,7 +943,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1067,7 +1072,7 @@ def list_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.FleetCredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_maintenance_configurations_operations.py index e30aaa41ddb4..0c96fa5bc900 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_managed_cluster_snapshots_operations.py index 00fc09b17c64..dce59d1bd07f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_managed_clusters_operations.py index 5590daf08bbb..6a5dbf3ad118 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -972,7 +977,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1036,7 +1041,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1125,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1267,7 +1272,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1412,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1539,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1591,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1796,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1997,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2107,7 +2112,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2296,7 +2301,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2498,7 +2503,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2542,7 +2547,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2645,7 +2650,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2747,7 +2752,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2851,7 +2856,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2956,7 +2961,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3178,7 +3183,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3255,7 +3260,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_operations.py index 9f13eabc71af..50fe69340cf0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_private_endpoint_connections_operations.py index de5af8c52e47..f249336c55e1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_private_link_resources_operations.py index 4f96a4f9977e..c1b8d062ee61 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_resolve_private_link_service_id_operations.py index 8ec50195f930..bd3b974d1b60 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_snapshots_operations.py index 6b3716fec41f..42c2b87165a8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_trusted_access_role_bindings_operations.py index 5c321daee779..8952dc2ff7c0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -268,7 +273,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -351,7 +356,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +495,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_09_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -567,7 +572,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_trusted_access_roles_operations.py index 5fb377b81bff..ee56b2af642d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_09_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_agent_pools_operations.py index f4932c1290e6..38cae880012f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_maintenance_configurations_operations.py index 07fa6466fe95..af7d2fe59781 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index dfbb1b815ca5..26401c070354 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_managed_clusters_operations.py index 3d833d334e0f..93d4c4c17a26 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -394,7 +399,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +666,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +923,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1124,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1238,7 +1243,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1438,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1623,7 +1628,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1736,7 +1741,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1845,7 +1850,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1953,7 +1958,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2063,7 +2068,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2174,7 +2179,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2402,7 +2407,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2483,7 +2488,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_operations.py index 97d33a0eca9e..326c6a237ec7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_private_endpoint_connections_operations.py index 9bde89bb82b2..f77ed3c4a668 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_private_link_resources_operations.py index 06007cac20e2..1f4a727df104 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index ac7afba767ea..a755ffc88304 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_snapshots_operations.py index cba0996f23c6..d80aea75c594 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 1527fa451cbd..702d1e6ce492 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_trusted_access_roles_operations.py index 8a6bbd7ed650..9bb2d730d0b9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/models/_models_py3.py index 995856ecf62d..d34854e8954c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/models/_models_py3.py @@ -932,8 +932,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_10_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -970,8 +970,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_10_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2035,7 +2035,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2106,7 +2106,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6082,7 +6082,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6134,7 +6134,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_agent_pools_operations.py index 142c37de2613..cca93dffe323 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -409,7 +414,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +635,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1039,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1104,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_maintenance_configurations_operations.py index 65b54d244dfd..06b03e882974 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_managed_cluster_snapshots_operations.py index c9066fb1a678..4b0c408b83d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_managed_clusters_operations.py index f968992d3512..9bbf39d06c40 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -972,7 +977,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1036,7 +1041,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1125,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1267,7 +1272,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1412,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1539,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1591,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1796,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1997,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2111,7 +2116,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2306,7 +2311,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2496,7 +2501,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2609,7 +2614,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2718,7 +2723,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2826,7 +2831,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2936,7 +2941,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3047,7 +3052,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3275,7 +3280,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3356,7 +3361,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_operations.py index 069248931d9c..ef87c7d791e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_private_endpoint_connections_operations.py index ce42fca89fa4..f9d0ca820bd0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_private_link_resources_operations.py index 9709cdf19575..d96f956df365 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_resolve_private_link_service_id_operations.py index a2f2a5d4d929..573e1d9d6db2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_snapshots_operations.py index f6084d2dbb8c..027b50d8513a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_trusted_access_role_bindings_operations.py index a356667471a7..cc2fd8bad306 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_10_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_trusted_access_roles_operations.py index 479580604926..b0fd3f660e06 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_10_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_agent_pools_operations.py index df0cc919f692..5e35973a89cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,6 +42,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -429,7 +434,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -551,7 +556,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -614,7 +619,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -660,7 +665,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_maintenance_configurations_operations.py index 8f41cbdcd66d..81ed4cc85614 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_managed_clusters_operations.py index 6a015aae52b4..e8971942a354 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,6 +56,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,7 +101,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -240,7 +245,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +325,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +374,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -385,7 +390,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -448,7 +453,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -585,7 +590,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -644,7 +649,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -694,7 +699,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -894,7 +899,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1086,7 +1091,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1190,7 +1195,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1381,7 +1386,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1566,7 +1571,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1671,7 +1676,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1775,7 +1780,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1881,7 +1886,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1988,7 +1993,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2211,7 +2216,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2288,7 +2293,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_operations.py index df5c7ec33e8d..192e8ccf8506 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_private_endpoint_connections_operations.py index ce145d70ca1a..0258150df29f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_private_link_resources_operations.py index 65606e7296d0..3187e3601c10 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_resolve_private_link_service_id_operations.py index 39b6a6a90973..649ef0bcca63 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_snapshots_operations.py index 8d3e14789227..a5a041a2a35d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/models/_models_py3.py index 4eb2eb97ab15..3a708f3fd400 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/models/_models_py3.py @@ -770,8 +770,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_11_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -808,8 +808,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_11_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1568,7 +1568,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1639,7 +1639,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4842,7 +4842,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4892,7 +4892,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_agent_pools_operations.py index 3d4a57dcd387..7eb904a5c667 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -374,7 +379,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -457,7 +462,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -835,7 +840,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -944,7 +949,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_maintenance_configurations_operations.py index 6794ffb4d308..a5591cb34c01 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_managed_clusters_operations.py index 74afee6a7741..1300766aa270 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -923,7 +928,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -983,7 +988,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1065,7 +1070,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1145,7 +1150,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1194,7 +1199,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1210,7 +1215,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1273,7 +1278,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1346,7 +1351,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1410,7 +1415,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1474,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1519,7 +1524,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1719,7 +1724,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1911,7 +1916,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2015,7 +2020,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2206,7 +2211,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2391,7 +2396,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2496,7 +2501,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2600,7 +2605,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2706,7 +2711,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2813,7 +2818,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3036,7 +3041,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3113,7 +3118,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_operations.py index f875fb90c8f4..48337ba57894 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_private_endpoint_connections_operations.py index c51fafbf33df..508b4ae60d8a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_private_link_resources_operations.py index f9f02c37d0c0..41e5e7ffc156 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_resolve_private_link_service_id_operations.py index e92df4b3f447..67a0977a6eef 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_snapshots_operations.py index 31fa21064cb5..60d34acd017b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2022-11-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_agent_pools_operations.py index dc38a5e44c96..76f4f8e45a75 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_maintenance_configurations_operations.py index 8f33e9dba1ba..c676e298796b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 9f6cb27e28e7..d91dac777191 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_managed_clusters_operations.py index f87e288a11cb..1c9903e573d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -394,7 +399,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +666,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +923,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1124,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1238,7 +1243,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1438,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1623,7 +1628,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1736,7 +1741,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1845,7 +1850,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1953,7 +1958,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2063,7 +2068,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2174,7 +2179,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2402,7 +2407,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2483,7 +2488,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_operations.py index f1f0a943c8eb..5781021035c6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_private_endpoint_connections_operations.py index beaf9d1305c4..6bcaa666dc7a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_private_link_resources_operations.py index 6773d132aaee..6ae21cac7f12 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 602cdf8dc9c7..05fab6907261 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_snapshots_operations.py index 1cbff63b12ee..9b304c97eb72 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 948015f71118..603749850884 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_trusted_access_roles_operations.py index aa1eab2ab550..fa1828d576ca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/models/_models_py3.py index 97faaab44fe0..ed964fecca67 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/models/_models_py3.py @@ -932,8 +932,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_11_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -970,8 +970,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2022_11_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2035,7 +2035,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2106,7 +2106,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6118,7 +6118,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6170,7 +6170,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_agent_pools_operations.py index 3edc239beba2..ad729a783b95 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -409,7 +414,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +635,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1039,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1104,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_maintenance_configurations_operations.py index 27e8d50511d5..b1edfbda1bed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_managed_cluster_snapshots_operations.py index 6447578528d8..2f9820e54848 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_managed_clusters_operations.py index 0e2feb99acde..e876e8930fc2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -972,7 +977,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1036,7 +1041,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1125,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1267,7 +1272,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1412,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1539,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1591,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1796,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1997,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2111,7 +2116,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2306,7 +2311,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2496,7 +2501,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2609,7 +2614,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2718,7 +2723,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2826,7 +2831,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2936,7 +2941,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3047,7 +3052,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3275,7 +3280,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3356,7 +3361,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_operations.py index 355ce29d4e90..1dd7bbba8d9e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_private_endpoint_connections_operations.py index 6cbe7e1ae5dd..85fbbb354a5e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_private_link_resources_operations.py index 5840b9954075..1b34e5cc2873 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_resolve_private_link_service_id_operations.py index ddfcd31e97f5..cd1a0bfe24e7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_snapshots_operations.py index 02af6cdc02d0..7b9e68d07a20 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_trusted_access_role_bindings_operations.py index fc145bb04185..6aedd40b1b26 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_11_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_trusted_access_roles_operations.py index 42af755f0f30..65bc3cb46a5a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_11_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_agent_pools_operations.py index 9a3863efaf95..9d7f41255005 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_maintenance_configurations_operations.py index 8bdab6b1e1c5..546b0c2ae775 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_managed_clusters_operations.py index 60c4688f5ad1..72f2be8c4bf6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +162,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +246,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -386,7 +391,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -645,7 +650,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -695,7 +700,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -895,7 +900,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1087,7 +1092,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1191,7 +1196,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1382,7 +1387,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1449,7 +1454,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1480,7 +1485,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1509,7 +1514,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1573,7 +1578,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1678,7 +1683,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1787,7 +1792,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1891,7 +1896,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1997,7 +2002,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2104,7 +2109,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2327,7 +2332,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2404,7 +2409,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_operations.py index 52d5dc77b0c5..5806480968cd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_private_endpoint_connections_operations.py index 152227fd33e3..de3bb2b6f1f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_private_link_resources_operations.py index 109607845f74..e255f99d5335 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_resolve_private_link_service_id_operations.py index 842dd18e24a1..4bb6a78271da 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_snapshots_operations.py index bd1f2ccc17d6..725795cd7ee1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/models/_models_py3.py index eea595291fbf..3ffb0a0743cf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/models/_models_py3.py @@ -770,8 +770,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_01_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -808,8 +808,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_01_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1568,7 +1568,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1639,7 +1639,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4985,7 +4985,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5035,7 +5035,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_agent_pools_operations.py index a9fa773a55bf..0f220233b3b8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -399,7 +404,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +618,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +874,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1059,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_maintenance_configurations_operations.py index 35864ee5fc8d..9af4f063985d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_managed_clusters_operations.py index 90960be7ef66..f152bbac2cbd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -963,7 +968,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1023,7 +1028,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1110,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1234,7 +1239,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1250,7 +1255,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1313,7 +1318,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1386,7 +1391,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1450,7 +1455,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,7 +1514,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1559,7 +1564,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1759,7 +1764,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1951,7 +1956,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2055,7 +2060,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2246,7 +2251,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2313,7 +2318,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2344,7 +2349,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2373,7 +2378,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2437,7 +2442,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2542,7 +2547,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2651,7 +2656,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2755,7 +2760,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2861,7 +2866,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2968,7 +2973,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3191,7 +3196,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3268,7 +3273,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_operations.py index ad85703bb459..6534af60ede9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_private_endpoint_connections_operations.py index a254722e15cf..52f1413e7a2f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_private_link_resources_operations.py index e99c43326b8c..33bb2843759c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_resolve_private_link_service_id_operations.py index babfffb8016c..e26c4927b390 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_snapshots_operations.py index 75d5dbf6c2fa..c437a3a167a3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_agent_pools_operations.py index 64f116183813..96b90bd7ce75 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_maintenance_configurations_operations.py index 97b89f39e80a..eeaea7a9b275 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 79f0b0672031..476d6b17397f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_managed_clusters_operations.py index 30e07d396475..39e2db944071 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -394,7 +399,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +666,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +923,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1124,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1238,7 +1243,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1438,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1502,7 +1507,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1534,7 +1539,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1563,7 +1568,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1742,7 +1747,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1851,7 +1856,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1959,7 +1964,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2069,7 +2074,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2180,7 +2185,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2408,7 +2413,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2489,7 +2494,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_operations.py index fd8d3fad81d6..7b42e8580d95 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_private_endpoint_connections_operations.py index d9a77a758a09..62a65e592dab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_private_link_resources_operations.py index 3f66c12802ca..7e803ae0cede 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index ad0f6c8e17d3..ca31ba8fed79 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_snapshots_operations.py index 12161d86dd2c..732422701e57 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index d98d6867368a..29036a9f15ac 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_trusted_access_roles_operations.py index 212083cfe549..d26390c430c4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/models/_models_py3.py index 819bb533396c..f23af3009d15 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/models/_models_py3.py @@ -932,8 +932,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_01_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -970,8 +970,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_01_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2057,7 +2057,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2128,7 +2128,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6155,7 +6155,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6207,7 +6207,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_agent_pools_operations.py index 63e709475eb0..7cf46bc839cd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -409,7 +414,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +635,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1039,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1104,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_maintenance_configurations_operations.py index cb0d74af3c16..c4dde9c934f1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_managed_cluster_snapshots_operations.py index 81e9b2fbd4ce..fabb6608cf52 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_managed_clusters_operations.py index e3ca92159d15..e6eb10807aaf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -972,7 +977,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1036,7 +1041,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1125,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1267,7 +1272,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1412,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1539,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1591,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1796,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1997,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2111,7 +2116,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2306,7 +2311,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2375,7 +2380,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2407,7 +2412,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2436,7 +2441,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2502,7 +2507,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2615,7 +2620,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2724,7 +2729,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2832,7 +2837,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2942,7 +2947,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3053,7 +3058,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3281,7 +3286,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3362,7 +3367,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_operations.py index 1bb5039bfe24..fdc03a1552af 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_private_endpoint_connections_operations.py index 1125973b3d29..d16733e0a909 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_private_link_resources_operations.py index 500f409bd868..3b07899e6200 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_resolve_private_link_service_id_operations.py index 017b54441e0e..43ec21889ac6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_snapshots_operations.py index ecb59e5d40d2..efe35900b439 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_trusted_access_role_bindings_operations.py index 864dc128c61b..bb90795d71fe 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_01_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_trusted_access_roles_operations.py index 4dd61ba13264..509bac2a4d83 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_01_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_agent_pools_operations.py index 2045ac4d2c98..b715c93db8ca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_maintenance_configurations_operations.py index 35e02dfc6f22..b28de302a917 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_managed_clusters_operations.py index cba7bb5b98bb..e1c1208624a7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +162,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -241,7 +246,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -321,7 +326,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -386,7 +391,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -449,7 +454,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -645,7 +650,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -695,7 +700,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -895,7 +900,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1087,7 +1092,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1191,7 +1196,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1382,7 +1387,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1449,7 +1454,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1480,7 +1485,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1509,7 +1514,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1573,7 +1578,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1678,7 +1683,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1787,7 +1792,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1891,7 +1896,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1997,7 +2002,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2104,7 +2109,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2327,7 +2332,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2404,7 +2409,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_operations.py index eda303e63a38..54e3c6a93894 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_private_endpoint_connections_operations.py index 9f2c9a06ad90..18717fe2f516 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_private_link_resources_operations.py index 266b7b718200..7f06c87367be 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_resolve_private_link_service_id_operations.py index 46f0847bc60e..00fa8f243b82 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_snapshots_operations.py index defeaec5b2e3..44341f6b6951 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/models/_models_py3.py index 9ec28458c33e..99cb1ad39617 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/models/_models_py3.py @@ -770,8 +770,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_02_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -808,8 +808,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_02_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1355,7 +1355,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1426,7 +1426,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4841,7 +4841,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -4891,7 +4891,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_agent_pools_operations.py index 717dde2d0a7e..b8d0ff0e355f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -399,7 +404,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +618,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +874,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1059,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_maintenance_configurations_operations.py index 3a2d4a7c3928..6de7408b82d8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_managed_clusters_operations.py index dbe449e20ab5..a55e59dcc8b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -963,7 +968,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1023,7 +1028,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1105,7 +1110,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1234,7 +1239,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1250,7 +1255,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1313,7 +1318,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1386,7 +1391,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1450,7 +1455,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,7 +1514,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1559,7 +1564,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1759,7 +1764,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1951,7 +1956,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2055,7 +2060,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2246,7 +2251,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2313,7 +2318,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2344,7 +2349,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2373,7 +2378,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2437,7 +2442,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2542,7 +2547,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2651,7 +2656,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2755,7 +2760,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2861,7 +2866,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2968,7 +2973,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3191,7 +3196,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3268,7 +3273,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_operations.py index 8b2544cc6f84..ae3312c28cf0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_private_endpoint_connections_operations.py index 53c45fb7daa7..fbf303d09de5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_private_link_resources_operations.py index cdf97c12636d..2d6d0c082881 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_resolve_private_link_service_id_operations.py index 44ecdfe9b65b..54c0a03435b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_snapshots_operations.py index 5a91b9163818..c22937a8c1cd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_agent_pools_operations.py index a50b417f203b..21a5f01be2ed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_maintenance_configurations_operations.py index 4d87647f01d3..a714174c0da3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 0269ab708844..3e2b3f4eed8f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_managed_clusters_operations.py index e692a48cbe90..a7b2c4943773 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,6 +57,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,7 +102,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -327,7 +332,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -394,7 +399,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -459,7 +464,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -661,7 +666,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -713,7 +718,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -918,7 +923,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1124,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1238,7 +1243,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1433,7 +1438,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1502,7 +1507,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1534,7 +1539,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1563,7 +1568,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1742,7 +1747,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1851,7 +1856,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1959,7 +1964,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2069,7 +2074,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2180,7 +2185,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2408,7 +2413,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2489,7 +2494,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_operations.py index 80dea4ad4d53..63c91995fda8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_private_endpoint_connections_operations.py index 4404c99821a6..fb6085fa9d6a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_private_link_resources_operations.py index 180d6d6ac7c1..3463c5bdd5ac 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 2c3b34377bd8..19c12cd4509d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_snapshots_operations.py index 4c7f60f9b6a9..3f332f4cb7b2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 99f2d86c4bf3..8601cd3e35b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_trusted_access_roles_operations.py index fdcb2dd6a648..168a5600b6a9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/models/_models_py3.py index a98b0bb2a093..f553064159c6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/models/_models_py3.py @@ -932,8 +932,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -970,8 +970,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1908,7 +1908,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1979,7 +1979,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6031,7 +6031,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6083,7 +6083,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_agent_pools_operations.py index 5da54f4ef4d7..752b22d77926 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -409,7 +414,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +635,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1039,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1104,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_maintenance_configurations_operations.py index cd558e365927..37b4b2376b76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_managed_cluster_snapshots_operations.py index 87513b473c91..812fe61f4832 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_managed_clusters_operations.py index a4e4fc66c225..98051c7d07f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -972,7 +977,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1036,7 +1041,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1120,7 +1125,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1200,7 +1205,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1267,7 +1272,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1407,7 +1412,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1534,7 +1539,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1586,7 +1591,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1791,7 +1796,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1992,7 +1997,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2111,7 +2116,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2306,7 +2311,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2375,7 +2380,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2407,7 +2412,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2436,7 +2441,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2502,7 +2507,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2615,7 +2620,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2724,7 +2729,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2832,7 +2837,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2942,7 +2947,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3053,7 +3058,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3281,7 +3286,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3362,7 +3367,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_operations.py index a31d04b6d02a..d82f8475d160 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_private_endpoint_connections_operations.py index 0d4cf7f17a77..4c87a79bf89f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_private_link_resources_operations.py index 397bf902c87d..30ff40fb43e3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_resolve_private_link_service_id_operations.py index dee226fb37fe..ba5c3599c3f3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_snapshots_operations.py index 0dd5dd07651a..776d09aff9ca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_trusted_access_role_bindings_operations.py index 4c64f041b76f..d757ea06c63d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_02_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_trusted_access_roles_operations.py index 205f68be4e64..2c5897a405e5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_02_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_agent_pools_operations.py index be06f4cd1913..70d2f7aa9585 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_maintenance_configurations_operations.py index 28ca9c42f6ce..1443cc6cefef 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_managed_clusters_operations.py index cf06b5add87f..cf2eea884e93 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,6 +58,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +302,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -442,7 +447,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -578,7 +583,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -701,7 +706,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +756,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -951,7 +956,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1148,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1247,7 +1252,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1438,7 +1443,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1505,7 +1510,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1536,7 +1541,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1565,7 +1570,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1734,7 +1739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1843,7 +1848,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1947,7 +1952,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2053,7 +2058,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2160,7 +2165,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2383,7 +2388,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2460,7 +2465,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_operations.py index 1eb9cb110815..99c108f7bbcd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_private_endpoint_connections_operations.py index fbef77daa69e..f680e2ba56af 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_private_link_resources_operations.py index 9e69d3e65498..ce89f7ab14c2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_resolve_private_link_service_id_operations.py index e2a4464a3916..cdf2f1317484 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_snapshots_operations.py index 52466c21014a..dd22b845138f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/models/_models_py3.py index b3d2d8c824b5..0db89c4aa5e7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/models/_models_py3.py @@ -770,8 +770,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -808,8 +808,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1355,7 +1355,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1426,7 +1426,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4966,7 +4966,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5016,7 +5016,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_agent_pools_operations.py index 56524c99216b..b8ab6d271e00 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -399,7 +404,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +618,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +874,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1059,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_maintenance_configurations_operations.py index abb58a09bc1b..1d90871c0842 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_managed_clusters_operations.py index 16e654d14385..773be56bb96d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -991,7 +996,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1047,7 +1052,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1106,7 +1111,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1268,7 +1273,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1317,7 +1322,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1333,7 +1338,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1401,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1474,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1538,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1592,7 +1597,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1642,7 +1647,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1842,7 +1847,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2034,7 +2039,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2329,7 +2334,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2396,7 +2401,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2427,7 +2432,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2456,7 +2461,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2520,7 +2525,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2625,7 +2630,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2734,7 +2739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2838,7 +2843,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2944,7 +2949,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3051,7 +3056,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3274,7 +3279,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3351,7 +3356,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_operations.py index 312923cec8ec..5495c3b53b34 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_private_endpoint_connections_operations.py index 0fafe4545d7b..e82c7fc20aab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_private_link_resources_operations.py index 989625e356a3..f8283797aece 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_resolve_private_link_service_id_operations.py index 12a3aab95448..ef48eb264be7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_snapshots_operations.py index 917bb639d3a4..994e9145ebd5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-03-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_agent_pools_operations.py index 812880988e20..618fe7797c37 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_maintenance_configurations_operations.py index a5d2081e6312..a5bc11c50270 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index b3b120921aa5..aa27614bd0c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_managed_clusters_operations.py index 46df0bd1c204..5ffbd9063c95 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,6 +58,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +224,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +310,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,7 +390,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -452,7 +457,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +597,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -658,7 +663,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +724,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -771,7 +776,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -976,7 +981,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1177,7 +1182,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1296,7 +1301,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1491,7 +1496,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1560,7 +1565,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1592,7 +1597,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1621,7 +1626,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1687,7 +1692,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1800,7 +1805,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1909,7 +1914,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2017,7 +2022,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2127,7 +2132,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2238,7 +2243,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2466,7 +2471,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2547,7 +2552,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_operations.py index 69e53da1a4b4..543125e0b918 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_private_endpoint_connections_operations.py index 0f26a66cec69..e037dbe6d4d0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_private_link_resources_operations.py index 04c7d6b5be28..bd6312005516 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 76ddd1f39344..000836bf76ac 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_snapshots_operations.py index 2c545213ea8e..42e5025a2dc3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 12255dae9b37..70ea8106031b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_trusted_access_roles_operations.py index 9ce0c0be2d49..78f36f6b35c3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/models/_models_py3.py index 549131737bd5..5272511af2a1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/models/_models_py3.py @@ -932,8 +932,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_03_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -970,8 +970,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_03_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1908,7 +1908,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1979,7 +1979,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6158,7 +6158,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6210,7 +6210,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_agent_pools_operations.py index 51fb725dbb2b..ea616af5e083 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -409,7 +414,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +635,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1039,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1104,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_maintenance_configurations_operations.py index 56341ba6947b..ce7f57a3f3c4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_managed_cluster_snapshots_operations.py index 2c879b34a34c..5fd21fb3936c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_managed_clusters_operations.py index 623d2f023f31..276f90a8450e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1000,7 +1005,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1121,7 +1126,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1205,7 +1210,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1285,7 +1290,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1336,7 +1341,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1352,7 +1357,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1417,7 +1422,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1492,7 +1497,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1558,7 +1563,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1619,7 +1624,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1671,7 +1676,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1876,7 +1881,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2077,7 +2082,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2196,7 +2201,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2391,7 +2396,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2460,7 +2465,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2492,7 +2497,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2521,7 +2526,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2587,7 +2592,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2700,7 +2705,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2809,7 +2814,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2917,7 +2922,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3027,7 +3032,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3138,7 +3143,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3366,7 +3371,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3447,7 +3452,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_operations.py index 2085a501693d..5094b9bc0aad 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_private_endpoint_connections_operations.py index 6471471bd14d..ea4cf8e745a8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_private_link_resources_operations.py index f3a1bcbd1f14..f8efe380fb0b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_resolve_private_link_service_id_operations.py index c85a71a5e92c..9e35f5f9b358 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_snapshots_operations.py index 648b95050ed2..9ea904460237 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_trusted_access_role_bindings_operations.py index a65c1090c569..9710af2d7360 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_03_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_trusted_access_roles_operations.py index cf52a83f6822..ceb9a0364bbb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_03_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_agent_pools_operations.py index 8d4ca8beea64..a2a4068173dd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_maintenance_configurations_operations.py index dadb1cde1fc3..9811391e8157 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,7 +384,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_managed_clusters_operations.py index ac9e87626d38..027ace9d7f9b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,6 +58,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +302,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -442,7 +447,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -578,7 +583,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -701,7 +706,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +756,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -951,7 +956,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1148,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1247,7 +1252,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1438,7 +1443,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1505,7 +1510,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1536,7 +1541,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1565,7 +1570,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1734,7 +1739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1843,7 +1848,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1947,7 +1952,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2053,7 +2058,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2160,7 +2165,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2383,7 +2388,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2460,7 +2465,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_operations.py index 4a35836559bc..ad3108bf0d32 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_private_endpoint_connections_operations.py index 0f7f6aa10e21..3392cbb2bcec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -335,7 +340,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_private_link_resources_operations.py index 93b5d78f2cb8..486e2b4f72e6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_resolve_private_link_service_id_operations.py index 0cf84bb84113..b9184ed2e942 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_snapshots_operations.py index 4937cb8a5a1b..9556b56c2371 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/models/_models_py3.py index 6c210d8b3266..b3138d97e439 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/models/_models_py3.py @@ -770,8 +770,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_04_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -808,8 +808,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_04_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1345,7 +1345,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1416,7 +1416,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -4956,7 +4956,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5006,7 +5006,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_agent_pools_operations.py index c3ebf32f6f59..0b7a880cb4bf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -399,7 +404,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +618,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +874,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1059,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_maintenance_configurations_operations.py index 596bc2378a87..e224459737a5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -542,7 +547,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_managed_clusters_operations.py index adb632ed1483..1f1bd7eab9d0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -991,7 +996,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1047,7 +1052,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1106,7 +1111,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1268,7 +1273,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1317,7 +1322,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1333,7 +1338,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1401,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1474,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1538,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1592,7 +1597,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1642,7 +1647,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1842,7 +1847,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2034,7 +2039,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2329,7 +2334,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2396,7 +2401,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2427,7 +2432,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2456,7 +2461,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2520,7 +2525,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2625,7 +2630,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2734,7 +2739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2838,7 +2843,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2944,7 +2949,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3051,7 +3056,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3274,7 +3279,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3351,7 +3356,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_operations.py index f0c3f12594fe..538cf5b6cf2d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_private_endpoint_connections_operations.py index a7f6eb16224f..53faa33eff6f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_private_link_resources_operations.py index adb7d8fc87e2..2d6828b45625 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_resolve_private_link_service_id_operations.py index 60f98dba9ecb..cfc4a93e3eb0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_snapshots_operations.py index e019dcaa3ee0..cf6a42edd9c4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-04-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_agent_pools_operations.py index 465c9566d27c..4c37c105e512 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_maintenance_configurations_operations.py index 3d612287c14a..9336cbbf3851 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 913abbbca58d..043cf0dc0bfe 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_managed_clusters_operations.py index 331c169ca3a2..1e25da408078 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,6 +58,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +224,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +310,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,7 +390,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -452,7 +457,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +597,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -658,7 +663,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +724,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -771,7 +776,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -976,7 +981,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1177,7 +1182,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1296,7 +1301,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1491,7 +1496,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1560,7 +1565,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1592,7 +1597,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1621,7 +1626,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1687,7 +1692,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1800,7 +1805,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1909,7 +1914,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2017,7 +2022,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2127,7 +2132,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2238,7 +2243,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2466,7 +2471,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2547,7 +2552,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_operations.py index 1ece57633fcc..1e6151c6983e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_private_endpoint_connections_operations.py index 800a5adeca4c..6ffbefcffb25 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -343,7 +348,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_private_link_resources_operations.py index d324a159d722..a50c4e1f8945 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index de9fa37e5015..561715ff226c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_snapshots_operations.py index 6b0b39af563f..e84cc75bf48a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 47c7688ef6e8..47df74923eb9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +391,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_trusted_access_roles_operations.py index a08cb24ec57f..213fc8d86579 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/models/_models_py3.py index 00adf6ce8561..72e1455c2ff0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/models/_models_py3.py @@ -932,8 +932,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_04_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -970,8 +970,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_04_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1898,7 +1898,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1969,7 +1969,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6148,7 +6148,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6200,7 +6200,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_agent_pools_operations.py index 83c3a93bec48..0897d9318151 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -409,7 +414,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +635,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1039,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1104,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_maintenance_configurations_operations.py index 85c60323de07..680ba032303a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,7 +554,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_managed_cluster_snapshots_operations.py index 20fd80f716f0..0baa74fd838d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_managed_clusters_operations.py index 99d7962ad3bd..1e4a374e56b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1000,7 +1005,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1121,7 +1126,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1205,7 +1210,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1285,7 +1290,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1336,7 +1341,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1352,7 +1357,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1417,7 +1422,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1492,7 +1497,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1558,7 +1563,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1619,7 +1624,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1671,7 +1676,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1876,7 +1881,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2077,7 +2082,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2196,7 +2201,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2391,7 +2396,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2460,7 +2465,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2492,7 +2497,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2521,7 +2526,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2587,7 +2592,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2700,7 +2705,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2809,7 +2814,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2917,7 +2922,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3027,7 +3032,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3138,7 +3143,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3366,7 +3371,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3447,7 +3452,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_operations.py index 6afa86d394db..61c207fab04d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_private_endpoint_connections_operations.py index d3e512dcd1fe..361b42736156 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_private_link_resources_operations.py index a404c77daf64..0374ecfc3884 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_resolve_private_link_service_id_operations.py index fb0a7de524f3..921e37857f92 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_snapshots_operations.py index 3dbc95069022..375e93f13691 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_trusted_access_role_bindings_operations.py index 0431ba59d976..2192f9ce6df3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_trusted_access_roles_operations.py index 58cafb471ce3..69a2a55a5e20 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_04_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_agent_pools_operations.py index abda06a6762b..e165018a39cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_maintenance_configurations_operations.py index ee8598ceae62..47f5d9c99962 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_managed_clusters_operations.py index 1d6807ffce44..947bc60ad498 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,6 +58,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +302,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -442,7 +447,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -578,7 +583,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -701,7 +706,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +756,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -951,7 +956,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1148,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1247,7 +1252,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1438,7 +1443,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1505,7 +1510,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1536,7 +1541,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1565,7 +1570,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1734,7 +1739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1843,7 +1848,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1947,7 +1952,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2053,7 +2058,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2160,7 +2165,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2383,7 +2388,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2460,7 +2465,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_operations.py index 4dfb3693f1f1..936a1679f77a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_private_endpoint_connections_operations.py index e0ee98a9599f..c9ab47bb5d38 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_private_link_resources_operations.py index d92762e90fb4..6e041ff7128c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_resolve_private_link_service_id_operations.py index e4c032e25c1b..f4698cf31289 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_snapshots_operations.py index 996e6432d987..247187a57e6a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/models/_models_py3.py index 896e5335af4f..502544a35bae 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/models/_models_py3.py @@ -805,8 +805,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_05_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -843,8 +843,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_05_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1439,7 +1439,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1510,7 +1510,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5143,7 +5143,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5193,7 +5193,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_agent_pools_operations.py index 155653fa2aa2..2c27ca91ff2d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -399,7 +404,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +618,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +874,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1059,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_maintenance_configurations_operations.py index 4ed7806f2dfb..6177c3b3e1db 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_managed_clusters_operations.py index 4e9149a5d3a8..83e18203231c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -991,7 +996,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1047,7 +1052,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1106,7 +1111,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1268,7 +1273,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1317,7 +1322,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1333,7 +1338,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1401,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1474,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1538,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1592,7 +1597,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1642,7 +1647,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1842,7 +1847,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2034,7 +2039,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2329,7 +2334,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2396,7 +2401,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2427,7 +2432,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2456,7 +2461,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2520,7 +2525,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2625,7 +2630,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2734,7 +2739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2838,7 +2843,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2944,7 +2949,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3051,7 +3056,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3274,7 +3279,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3351,7 +3356,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_operations.py index c6f7d363c542..b4660db86d6f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_private_endpoint_connections_operations.py index aea38744ba1a..290963615015 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_private_link_resources_operations.py index 955fa2533cfc..7b1f5ffb62cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_resolve_private_link_service_id_operations.py index 500e13010b74..32087f37eaa1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_snapshots_operations.py index 60ab359959f1..7565950f0d30 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-05-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_05_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_agent_pools_operations.py index fc670236b012..60cdd59dd8b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_maintenance_configurations_operations.py index c387750ec9a2..7aadfc4f64f7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 5e324733ec48..c6b56dd7321a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_managed_clusters_operations.py index b238b5db123b..16329eb5825f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,6 +58,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +161,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -219,7 +224,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +310,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -385,7 +390,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +441,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -452,7 +457,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +522,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -592,7 +597,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -658,7 +663,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -719,7 +724,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -771,7 +776,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -976,7 +981,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1177,7 +1182,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1296,7 +1301,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1491,7 +1496,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1560,7 +1565,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1592,7 +1597,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1621,7 +1626,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1687,7 +1692,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1800,7 +1805,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1909,7 +1914,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2017,7 +2022,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2127,7 +2132,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2238,7 +2243,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2466,7 +2471,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2547,7 +2552,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_operations.py index d9e740c0d981..e1d7446755b9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_private_endpoint_connections_operations.py index 5fede1350e60..4813dec5e445 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_private_link_resources_operations.py index e3dc30bf335e..98257ab8025f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 33f9a44acc0d..8aa4dc835c58 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_snapshots_operations.py index 1bfe5cd59070..6b49da629c9a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 19ea91334733..00cc465396e3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_trusted_access_roles_operations.py index 542c1dc5ee95..25cc38e8eaa8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/models/_models_py3.py index d6cf2daa84d3..6c1f8b005f29 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/models/_models_py3.py @@ -932,8 +932,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_05_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -970,8 +970,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_05_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1908,7 +1908,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1979,7 +1979,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6158,7 +6158,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6210,7 +6210,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_agent_pools_operations.py index dbc2d2a29dc4..49e40de8c41d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -409,7 +414,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +635,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1039,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1104,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_maintenance_configurations_operations.py index de748875aa19..dc4ec440585a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_managed_cluster_snapshots_operations.py index 2a3728d45882..6dc2f2dfffdd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_managed_clusters_operations.py index 096fec7dab62..3f08eb0038ba 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1000,7 +1005,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1121,7 +1126,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1205,7 +1210,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1285,7 +1290,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1336,7 +1341,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1352,7 +1357,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1417,7 +1422,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1492,7 +1497,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1558,7 +1563,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1619,7 +1624,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1671,7 +1676,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1876,7 +1881,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2077,7 +2082,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2196,7 +2201,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2391,7 +2396,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2460,7 +2465,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2492,7 +2497,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2521,7 +2526,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2587,7 +2592,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2700,7 +2705,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2809,7 +2814,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2917,7 +2922,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3027,7 +3032,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3138,7 +3143,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3366,7 +3371,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3447,7 +3452,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_operations.py index f73f5bb67870..b9c251a5905d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_private_endpoint_connections_operations.py index 9915741fec46..0d15844cb0d4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_private_link_resources_operations.py index 722b003b564f..53135c214319 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_resolve_private_link_service_id_operations.py index cd437f5ae002..a464ce407b11 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_snapshots_operations.py index bd5b3eb80bfb..e0ed417cf69a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_trusted_access_role_bindings_operations.py index bf28f84eb413..185bca10c78b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_trusted_access_roles_operations.py index ebefc6774e1f..66b09ec21bf1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_05_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_agent_pools_operations.py index 633375972dc9..03a30c3ea981 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_maintenance_configurations_operations.py index ae093b3bb48f..6bcf82142198 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_managed_clusters_operations.py index 420425387587..5fff8e023ff9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,6 +58,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +302,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -442,7 +447,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -578,7 +583,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -701,7 +706,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +756,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -951,7 +956,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1148,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1247,7 +1252,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1438,7 +1443,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1505,7 +1510,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1536,7 +1541,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1565,7 +1570,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1734,7 +1739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1843,7 +1848,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1947,7 +1952,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2053,7 +2058,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2160,7 +2165,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2383,7 +2388,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2460,7 +2465,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_operations.py index 7a816c70f91c..4db2a06757c3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_private_endpoint_connections_operations.py index ecfd9bb7d8b9..ab640b17778a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_private_link_resources_operations.py index 15ee589c98e4..0170f44457fc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_resolve_private_link_service_id_operations.py index d67b9bae4c83..516246daf64f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_snapshots_operations.py index e4809fa96616..6b1d9ddd2625 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/models/_models_py3.py index d2a8cdbbd0e0..535e83457d03 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/models/_models_py3.py @@ -823,8 +823,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_06_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -861,8 +861,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_06_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1505,7 +1505,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1576,7 +1576,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5236,7 +5236,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5286,7 +5286,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_agent_pools_operations.py index 7216e9127fe9..4f7c246b0796 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -399,7 +404,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +618,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +874,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1059,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_maintenance_configurations_operations.py index 182b531774d1..e6e7cd20006c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_managed_clusters_operations.py index 19bacd9457d2..44e5994fde66 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -991,7 +996,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1047,7 +1052,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1106,7 +1111,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1268,7 +1273,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1317,7 +1322,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1333,7 +1338,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1401,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1474,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1538,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1592,7 +1597,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1642,7 +1647,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1842,7 +1847,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2034,7 +2039,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2329,7 +2334,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2396,7 +2401,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2427,7 +2432,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2456,7 +2461,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2520,7 +2525,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2625,7 +2630,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2734,7 +2739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2838,7 +2843,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2944,7 +2949,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3051,7 +3056,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3274,7 +3279,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3351,7 +3356,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_operations.py index 1bf323e11b08..3951d3b24468 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_private_endpoint_connections_operations.py index c6412595edb9..69d8d3fec6d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_private_link_resources_operations.py index cee0d69a103a..40b664fef9f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_resolve_private_link_service_id_operations.py index ae0d4bbf0b38..2a41b7dd48b3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_snapshots_operations.py index fc133ff54f6c..243562ef1d46 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-06-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_agent_pools_operations.py index d12ab656419e..a615d1cb9c9d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_maintenance_configurations_operations.py index 40f75edd9ba5..2496dabb20aa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 809fff07b9dc..3bddefc6cb40 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_managed_clusters_operations.py index df8e96116e67..07c0854a08a1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -61,6 +62,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,7 +107,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +165,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -223,7 +228,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -389,7 +394,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +445,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -456,7 +461,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -662,7 +667,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -723,7 +728,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -775,7 +780,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -980,7 +985,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1181,7 +1186,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1300,7 +1305,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1495,7 +1500,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1564,7 +1569,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1596,7 +1601,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1625,7 +1630,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1691,7 +1696,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1804,7 +1809,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1913,7 +1918,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2021,7 +2026,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2131,7 +2136,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2242,7 +2247,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2470,7 +2475,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2551,7 +2556,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2637,7 +2642,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2715,7 +2720,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2786,7 +2791,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2869,7 +2874,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_operations.py index 5cac4266358f..44aab7ca4ce6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_private_endpoint_connections_operations.py index 2c746ed8ba84..ac3723deb9f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_private_link_resources_operations.py index 6aa290bf73a6..1a20c80734dc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index a6dc7a1af0e8..14b88b5c2cb8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_snapshots_operations.py index 7b75fd10e368..1df231eb6c3b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index ec4debc37488..5fd7cbe0dfd3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_trusted_access_roles_operations.py index 37c069c7a3dd..3dcd5a767a1b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/models/_models_py3.py index c698802f8609..2ca22b6091ab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/models/_models_py3.py @@ -983,8 +983,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_06_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -1021,8 +1021,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_06_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2186,7 +2186,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2257,7 +2257,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -6502,7 +6502,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6554,7 +6554,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_agent_pools_operations.py index 23079b411600..fec568c65f92 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -409,7 +414,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -547,7 +552,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -630,7 +635,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -684,7 +689,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -898,7 +903,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1034,7 +1039,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1099,7 +1104,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_maintenance_configurations_operations.py index fc90d558f08b..d2c73f5dd5f1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_managed_cluster_snapshots_operations.py index 074cc1059778..ef744de1e90d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_managed_clusters_operations.py index bec1e3d9cf14..4855860f93b8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1156,7 +1161,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1214,7 +1219,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1282,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1361,7 +1366,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1441,7 +1446,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1492,7 +1497,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1508,7 +1513,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1573,7 +1578,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1648,7 +1653,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1714,7 +1719,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1775,7 +1780,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1827,7 +1832,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2032,7 +2037,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2233,7 +2238,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2352,7 +2357,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2547,7 +2552,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2616,7 +2621,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2648,7 +2653,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2677,7 +2682,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2743,7 +2748,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2856,7 +2861,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2965,7 +2970,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3073,7 +3078,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3183,7 +3188,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3294,7 +3299,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3522,7 +3527,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3603,7 +3608,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3689,7 +3694,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3767,7 +3772,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3838,7 +3843,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3921,7 +3926,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_operations.py index 3fd9ad0f838c..5bb39f24dc8c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_private_endpoint_connections_operations.py index 8564e1f86ac2..043076c504e5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_private_link_resources_operations.py index f5706f856300..f73618dc8e5c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_resolve_private_link_service_id_operations.py index 5372339284fb..545af5c9a23f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_snapshots_operations.py index 67af4d45c8ba..7b3d1eb783c1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_trusted_access_role_bindings_operations.py index b751edb093d4..8c52789a23b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_trusted_access_roles_operations.py index 433c2e685894..ef45a42f513f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_06_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_agent_pools_operations.py index 0fab80981bc8..babe83b74901 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_maintenance_configurations_operations.py index e1cc0268c0fa..ce05dec6c88b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_managed_clusters_operations.py index 6755eab01a17..092126b04b4b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,6 +58,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,7 +103,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -154,7 +159,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +218,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +302,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -377,7 +382,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -426,7 +431,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -442,7 +447,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -578,7 +583,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -642,7 +647,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -701,7 +706,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -751,7 +756,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -951,7 +956,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1143,7 +1148,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1247,7 +1252,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1438,7 +1443,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1505,7 +1510,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1536,7 +1541,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1565,7 +1570,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1734,7 +1739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1843,7 +1848,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1947,7 +1952,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2053,7 +2058,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2160,7 +2165,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2383,7 +2388,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2460,7 +2465,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_operations.py index 17cc2d888d10..efc1b5396593 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_private_endpoint_connections_operations.py index 1b4410149ab5..3dabf348decb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_private_link_resources_operations.py index cc4493fbed63..ec3a13735e7d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_resolve_private_link_service_id_operations.py index 700e6cc1d47a..7582a5d6b2c8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_snapshots_operations.py index 52cbc4aa3575..e3cf836db1b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/models/_models_py3.py index 48695d7458f6..d1e8b3d2a1b8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/models/_models_py3.py @@ -823,8 +823,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_07_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -861,8 +861,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_07_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1527,7 +1527,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1598,7 +1598,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5267,7 +5267,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5317,7 +5317,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_agent_pools_operations.py index a4e6039a6399..4c7e4fbe447b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -399,7 +404,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +618,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +874,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1059,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_maintenance_configurations_operations.py index 324719edf678..2c9482d896e7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_managed_clusters_operations.py index 8811f42d89f0..c3646eb55c04 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -991,7 +996,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1047,7 +1052,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1106,7 +1111,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1188,7 +1193,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1268,7 +1273,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1317,7 +1322,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1333,7 +1338,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1396,7 +1401,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1469,7 +1474,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1533,7 +1538,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1592,7 +1597,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1642,7 +1647,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1842,7 +1847,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2034,7 +2039,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2138,7 +2143,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2329,7 +2334,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2396,7 +2401,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2427,7 +2432,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2456,7 +2461,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2520,7 +2525,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2625,7 +2630,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2734,7 +2739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2838,7 +2843,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2944,7 +2949,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3051,7 +3056,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3274,7 +3279,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3351,7 +3356,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_operations.py index 9b6dce459487..f969911f5dbc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_private_endpoint_connections_operations.py index 43864bcffcce..db11dc602756 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_private_link_resources_operations.py index aaf390157fe4..2fff9c53ff15 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_resolve_private_link_service_id_operations.py index d22bfbb1a760..ceb2e3823671 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_snapshots_operations.py index 9292afa7a597..bb81cbf69ff7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-07-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_agent_pools_operations.py index 7e785f06aee4..2cd1201ed605 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_machines_operations.py index 55901488ff13..c27480c7252f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._machines_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_maintenance_configurations_operations.py index 8f9832c4dd30..96b4f00affc1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 32282f61d589..b7a01c0ffb84 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_managed_clusters_operations.py index 3463ee7b9004..a30335b60a4b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,6 +64,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,7 +109,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +167,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +230,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +396,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -442,7 +447,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -458,7 +463,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +528,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +603,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -664,7 +669,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -725,7 +730,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -777,7 +782,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -982,7 +987,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1183,7 +1188,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1302,7 +1307,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1497,7 +1502,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1566,7 +1571,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1598,7 +1603,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1627,7 +1632,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1693,7 +1698,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1806,7 +1811,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2023,7 +2028,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2133,7 +2138,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2244,7 +2249,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2472,7 +2477,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2553,7 +2558,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2633,7 +2638,7 @@ async def get_guardrails_versions( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2703,7 +2708,7 @@ def list_guardrails_versions( ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2788,7 +2793,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2866,7 +2871,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2937,7 +2942,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3020,7 +3025,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_operations.py index 1fbe29b6b38e..2cf6c96ff782 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_private_endpoint_connections_operations.py index 76aae5695f5a..d4f7095f1d5e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_private_link_resources_operations.py index 6d233bf35877..694ecbd2725e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 67861dd0906a..d01695188807 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_snapshots_operations.py index 18d034dfd8ce..9b9ae67a29e6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index be9fd91eeea4..506accd8198b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_trusted_access_roles_operations.py index 252b5acbbc38..6292a82cb492 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/models/_models_py3.py index 5f2d1699678b..86a332b1f984 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/models/_models_py3.py @@ -983,8 +983,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_07_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -1021,8 +1021,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_07_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2337,7 +2337,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2408,7 +2408,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -7034,7 +7034,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -7086,7 +7086,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_agent_pools_operations.py index 0edc3dd5fdc1..08103b00249b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -413,7 +418,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -551,7 +556,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +639,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -902,7 +907,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1038,7 +1043,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1103,7 +1108,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1151,7 +1156,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_machines_operations.py index ed8726f8e5f3..1b13f0e7fefd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +269,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_maintenance_configurations_operations.py index 5ad369980039..a4f2c5b30575 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_managed_cluster_snapshots_operations.py index 490c626223bb..b72768569a51 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_managed_clusters_operations.py index bf32e1be2576..9d5e923372e8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1215,7 +1220,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1273,7 +1278,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1336,7 +1341,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1420,7 +1425,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1500,7 +1505,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1551,7 +1556,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1567,7 +1572,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1632,7 +1637,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1707,7 +1712,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1773,7 +1778,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1834,7 +1839,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1886,7 +1891,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2091,7 +2096,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2292,7 +2297,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2411,7 +2416,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2606,7 +2611,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2675,7 +2680,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2707,7 +2712,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2736,7 +2741,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2802,7 +2807,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2915,7 +2920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3024,7 +3029,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3132,7 +3137,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3242,7 +3247,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3353,7 +3358,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3581,7 +3586,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3662,7 +3667,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3740,7 +3745,7 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3808,7 +3813,7 @@ def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_m ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3893,7 +3898,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3971,7 +3976,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4042,7 +4047,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4125,7 +4130,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_operations.py index d54b62644b61..c5a368e19886 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_private_endpoint_connections_operations.py index 7eef33519cce..fed91f5dfb98 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_private_link_resources_operations.py index 353e9ba08c2d..8afe171e25ed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_resolve_private_link_service_id_operations.py index 24daa0d5ae14..919451f9b5cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_snapshots_operations.py index 761a1a72b30b..3aa8906a21d1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_trusted_access_role_bindings_operations.py index fbe9d7093427..963b85ad1088 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_07_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -586,7 +591,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_trusted_access_roles_operations.py index 19d3ea5ed9db..dff53009a745 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_07_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_agent_pools_operations.py index 1839b70dc0e3..1c70f1c4220e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_maintenance_configurations_operations.py index ae2fed5a25d6..c124789defa2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_managed_clusters_operations.py index 35f8da355d4e..d6dfbfe7badb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -61,6 +62,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,7 +107,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +222,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +386,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +435,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -446,7 +451,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +651,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -755,7 +760,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +960,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1442,7 +1447,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,7 +1514,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1540,7 +1545,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1569,7 +1574,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1633,7 +1638,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1738,7 +1743,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1847,7 +1852,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1951,7 +1956,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2164,7 +2169,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2387,7 +2392,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2464,7 +2469,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2548,7 +2553,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2626,7 +2631,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2693,7 +2698,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2776,7 +2781,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_operations.py index 7374644e2b4f..80282a98fdfb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_private_endpoint_connections_operations.py index 35058ead9f8f..f1eba3129896 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_private_link_resources_operations.py index a39c1e4b748f..8a5cdc25e0a4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_resolve_private_link_service_id_operations.py index 22101eac45ba..b0241de6ca2b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_snapshots_operations.py index ecbdc97650ef..86df88a92e12 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/models/_models_py3.py index e464dd2feb25..912502cd2b01 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/models/_models_py3.py @@ -823,8 +823,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_08_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -861,8 +861,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_08_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1786,7 +1786,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1857,7 +1857,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5541,7 +5541,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5591,7 +5591,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_agent_pools_operations.py index 0d04f565865c..f9462ce9ce33 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -399,7 +404,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +535,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -613,7 +618,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -869,7 +874,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -991,7 +996,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1054,7 +1059,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1100,7 +1105,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_maintenance_configurations_operations.py index 077101efcc9a..769508f434fe 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_managed_clusters_operations.py index e92959d1ae97..779ee1be257d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1147,7 +1152,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1208,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1262,7 +1267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1349,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1424,7 +1429,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1489,7 +1494,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1552,7 +1557,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1689,7 +1694,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1798,7 +1803,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1998,7 +2003,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2190,7 +2195,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2294,7 +2299,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2485,7 +2490,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2552,7 +2557,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2583,7 +2588,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2612,7 +2617,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2676,7 +2681,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2781,7 +2786,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2890,7 +2895,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2994,7 +2999,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3100,7 +3105,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3207,7 +3212,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3430,7 +3435,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3507,7 +3512,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3591,7 +3596,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3669,7 +3674,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3736,7 +3741,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3819,7 +3824,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_operations.py index 5bdc8db1fed7..0a9c9c2db861 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_private_endpoint_connections_operations.py index bdbff49541cc..d856997aca32 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_private_link_resources_operations.py index 7925051b9799..14fb595e3d69 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_resolve_private_link_service_id_operations.py index 2d036a11d1f1..3856d9fada16 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_snapshots_operations.py index 8c70b7cc37fb..590278c3dff9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-08-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_agent_pools_operations.py index 217dd4cfe567..f584a0c66147 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_machines_operations.py index 31d124cb2a71..270ae0da523c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._machines_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_maintenance_configurations_operations.py index 0fe53919cecb..83bbbfdc768f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index b8ea2e33e742..b29a58c04cca 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_managed_clusters_operations.py index 606026446ba3..24d3fd32bf47 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,6 +64,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,7 +109,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +167,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +230,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +396,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -442,7 +447,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -458,7 +463,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +528,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +603,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -664,7 +669,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -725,7 +730,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -777,7 +782,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -982,7 +987,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1183,7 +1188,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1302,7 +1307,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1497,7 +1502,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1566,7 +1571,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1598,7 +1603,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1627,7 +1632,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1693,7 +1698,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1806,7 +1811,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2023,7 +2028,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2133,7 +2138,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2244,7 +2249,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2472,7 +2477,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2553,7 +2558,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2633,7 +2638,7 @@ async def get_guardrails_versions( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2703,7 +2708,7 @@ def list_guardrails_versions( ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2788,7 +2793,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2866,7 +2871,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2937,7 +2942,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3020,7 +3025,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_operations.py index bc15af88ed61..7e6f89058460 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_private_endpoint_connections_operations.py index 426f2f978767..831967843a85 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_private_link_resources_operations.py index ec94069787f4..df2d90f09404 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index e80af4e998e6..81a17371d9b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_snapshots_operations.py index 9b9ee0bf1b3c..0b34cbb17b93 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index ebd20a77c83f..22142282f1fa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +445,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_trusted_access_roles_operations.py index f4adc317cf30..a9671b9a54cb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/models/_models_py3.py index 77fd7502e0f3..9a8166725202 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/models/_models_py3.py @@ -983,8 +983,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_08_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -1021,8 +1021,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_08_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2430,7 +2430,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2501,7 +2501,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -7173,7 +7173,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -7225,7 +7225,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_agent_pools_operations.py index 767e28c3d1b0..74f0d916b380 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -413,7 +418,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -551,7 +556,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +639,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -902,7 +907,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1038,7 +1043,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1103,7 +1108,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1151,7 +1156,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_machines_operations.py index cdf07598390f..c956cad13270 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +269,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_maintenance_configurations_operations.py index 9c5671149407..eb6684a55224 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_managed_cluster_snapshots_operations.py index 964e2bce543c..1625a0591032 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_managed_clusters_operations.py index fe6bcd8c2625..1e6e53d2bfdb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1215,7 +1220,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1273,7 +1278,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1336,7 +1341,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1420,7 +1425,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1500,7 +1505,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1551,7 +1556,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1567,7 +1572,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1632,7 +1637,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1707,7 +1712,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1773,7 +1778,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1834,7 +1839,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1886,7 +1891,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2091,7 +2096,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2292,7 +2297,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2411,7 +2416,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2606,7 +2611,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2675,7 +2680,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2707,7 +2712,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2736,7 +2741,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2802,7 +2807,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2915,7 +2920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3024,7 +3029,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3132,7 +3137,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3242,7 +3247,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3353,7 +3358,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3581,7 +3586,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3662,7 +3667,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3740,7 +3745,7 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3808,7 +3813,7 @@ def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_m ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3893,7 +3898,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3971,7 +3976,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4042,7 +4047,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4125,7 +4130,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_operations.py index 1701e510780d..25796fa7cf4b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_private_endpoint_connections_operations.py index b77e6a011b0d..a08d2be4c209 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_private_link_resources_operations.py index 4edc5155667d..3ea55554b850 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_resolve_private_link_service_id_operations.py index 36779e23494d..bf75be101f67 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_snapshots_operations.py index 80271a2a077d..2ebbc083999f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_trusted_access_role_bindings_operations.py index 96a1a5670b2c..5f5fb25f2c47 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -285,7 +290,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_08_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +427,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +641,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_trusted_access_roles_operations.py index 44129572c1ad..fa6a8d248d7f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_08_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_agent_pools_operations.py index 05f0e49eba18..bff402531016 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_maintenance_configurations_operations.py index ea7fdd5f0817..6de924a66b74 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_managed_clusters_operations.py index cb5e0c71ebb6..ad79f1122a74 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -61,6 +62,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,7 +107,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +222,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +386,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +435,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -446,7 +451,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +651,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -755,7 +760,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +960,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1442,7 +1447,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,7 +1514,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1540,7 +1545,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1569,7 +1574,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1633,7 +1638,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1738,7 +1743,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1847,7 +1852,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1951,7 +1956,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2164,7 +2169,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2387,7 +2392,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2464,7 +2469,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2548,7 +2553,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2626,7 +2631,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2693,7 +2698,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2776,7 +2781,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_operations.py index d509fefdc188..c093a7503c98 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_private_endpoint_connections_operations.py index 102e871f30d1..a71e3ec425f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_private_link_resources_operations.py index 78d39af4fdd9..32651c997524 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_resolve_private_link_service_id_operations.py index 1751fef579a6..111e5a006b26 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_snapshots_operations.py index bdcba6812b61..0824e45082be 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_trusted_access_role_bindings_operations.py index c6620120e1e4..2160e83b03d9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +437,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_trusted_access_roles_operations.py index 8451525474d9..93a91ff8d425 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/models/_models_py3.py index e6ca29bd6262..5e37bf71041d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/models/_models_py3.py @@ -823,8 +823,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_09_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -861,8 +861,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_09_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1879,7 +1879,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -1950,7 +1950,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5634,7 +5634,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5684,7 +5684,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_agent_pools_operations.py index 370816ca4c5f..fe2f73052aaa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -403,7 +408,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -617,7 +622,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +674,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +878,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -995,7 +1000,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1104,7 +1109,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_maintenance_configurations_operations.py index 75e0b66b12e1..75e54e1cedd8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_managed_clusters_operations.py index 41a0b22fe863..a94699d2098c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1147,7 +1152,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1208,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1262,7 +1267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1349,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1424,7 +1429,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1489,7 +1494,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1552,7 +1557,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1689,7 +1694,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1798,7 +1803,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1998,7 +2003,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2190,7 +2195,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2294,7 +2299,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2485,7 +2490,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2552,7 +2557,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2583,7 +2588,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2612,7 +2617,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2676,7 +2681,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2781,7 +2786,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2890,7 +2895,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2994,7 +2999,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3100,7 +3105,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3207,7 +3212,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3430,7 +3435,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3507,7 +3512,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3591,7 +3596,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3669,7 +3674,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3736,7 +3741,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3819,7 +3824,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_operations.py index ea6690adf91e..e6776ba69684 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_private_endpoint_connections_operations.py index ba7daabf57fe..f3af08ee6f06 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_private_link_resources_operations.py index 42a2362070c0..80380c28cb56 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_resolve_private_link_service_id_operations.py index fb7cf0653fc2..bf8329d703db 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_snapshots_operations.py index e56dfd4f0a7c..b217f8ed9012 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_trusted_access_role_bindings_operations.py index 660872649c2b..461663320653 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +633,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_trusted_access_roles_operations.py index 2071b26dc871..854dfc46e3d4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_01/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -103,7 +108,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-09-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_agent_pools_operations.py index b198a904f26f..e8dc178ba4b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -207,7 +212,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -290,7 +295,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -344,7 +349,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -561,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +702,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -762,7 +767,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -810,7 +815,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_machines_operations.py index 758e0a3486c0..550509544b14 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._machines_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_maintenance_configurations_operations.py index 1c713aa1b479..fe3ad31632b1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index b77c0224b537..fe9eb7b5df73 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_managed_clusters_operations.py index c9b068aeb101..aa39ad41ed9c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,6 +64,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,7 +109,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +167,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +230,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +396,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -442,7 +447,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -458,7 +463,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +528,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +603,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -664,7 +669,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -725,7 +730,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -777,7 +782,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -982,7 +987,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1183,7 +1188,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1302,7 +1307,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1497,7 +1502,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1566,7 +1571,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1598,7 +1603,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1627,7 +1632,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1693,7 +1698,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1806,7 +1811,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2023,7 +2028,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2133,7 +2138,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2244,7 +2249,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2472,7 +2477,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2553,7 +2558,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2633,7 +2638,7 @@ async def get_guardrails_versions( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2703,7 +2708,7 @@ def list_guardrails_versions( ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2788,7 +2793,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2866,7 +2871,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2937,7 +2942,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3020,7 +3025,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_operations.py index ecf0a70ee6c6..0ed6c3d89e80 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_private_endpoint_connections_operations.py index b3fc7a869846..030ae0844c61 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_private_link_resources_operations.py index 7a98b5b1735a..9ec6b65dbfda 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 3268e46f143f..363864747392 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_snapshots_operations.py index 7de8cc0c9b29..93bd79b7903d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 1abeff197e1b..7762be5f25a8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +445,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_trusted_access_roles_operations.py index 35e881704804..6a898d16aeb8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/models/_models_py3.py index cc7666bb172b..adc7a2c01219 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/models/_models_py3.py @@ -1072,8 +1072,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_09_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -1110,8 +1110,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_09_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2519,7 +2519,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2590,7 +2590,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -7370,7 +7370,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -7422,7 +7422,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_agent_pools_operations.py index b6f3c3e4d549..66b7f4e07e2c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -413,7 +418,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -551,7 +556,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -634,7 +639,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -688,7 +693,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -902,7 +907,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1038,7 +1043,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1103,7 +1108,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1151,7 +1156,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_machines_operations.py index bda72b143355..3a2e48109ebc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +269,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_maintenance_configurations_operations.py index 09cc61b1211d..300da1e531f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_managed_cluster_snapshots_operations.py index 5ba7ff826750..771abf2aa326 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_managed_clusters_operations.py index bdc72ec76162..0f489da58bf5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1215,7 +1220,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1273,7 +1278,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1336,7 +1341,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1420,7 +1425,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1500,7 +1505,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1551,7 +1556,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1567,7 +1572,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1632,7 +1637,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1707,7 +1712,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1773,7 +1778,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1834,7 +1839,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1886,7 +1891,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2091,7 +2096,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2292,7 +2297,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2411,7 +2416,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2606,7 +2611,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2675,7 +2680,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2707,7 +2712,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2736,7 +2741,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2802,7 +2807,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2915,7 +2920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3024,7 +3029,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3132,7 +3137,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3242,7 +3247,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3353,7 +3358,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3581,7 +3586,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3662,7 +3667,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3740,7 +3745,7 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3808,7 +3813,7 @@ def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_m ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3893,7 +3898,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3971,7 +3976,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4042,7 +4047,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4125,7 +4130,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_operations.py index 591298762e62..d6913fc5b689 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_private_endpoint_connections_operations.py index 8318e4f76370..ce1f8bb94aba 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_private_link_resources_operations.py index ddbbc87a28ad..d8c57d3e6fbd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_resolve_private_link_service_id_operations.py index b29ee81f91d5..eeea873ec410 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_snapshots_operations.py index 4760b58461e7..1b1e353f63c5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_trusted_access_role_bindings_operations.py index 836c22928446..1f2e045d72a5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -285,7 +290,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_09_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +427,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +641,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_trusted_access_roles_operations.py index 7631490b4664..99ae775da5f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_09_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_agent_pools_operations.py index c4406a925031..d0967e844bf9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_maintenance_configurations_operations.py index 33ae48b7285a..17fe2ee67f34 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_managed_clusters_operations.py index 3e38d307c3fd..19f65e1efb30 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -61,6 +62,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,7 +107,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +222,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +386,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +435,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -446,7 +451,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +651,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -755,7 +760,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +960,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1442,7 +1447,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,7 +1514,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1540,7 +1545,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1569,7 +1574,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1633,7 +1638,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1738,7 +1743,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1847,7 +1852,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1951,7 +1956,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2164,7 +2169,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2387,7 +2392,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2464,7 +2469,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2548,7 +2553,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2626,7 +2631,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2693,7 +2698,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2776,7 +2781,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_operations.py index 63fc95892d3b..9438e7f83620 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_private_endpoint_connections_operations.py index 7bc2fd3699c0..8f7320d90397 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_private_link_resources_operations.py index 169343c928ff..602a861ab161 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_resolve_private_link_service_id_operations.py index af7dd3449c77..8339ef6fc95f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_snapshots_operations.py index 3221b6ecdee6..a4167ca14311 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_trusted_access_role_bindings_operations.py index 411acbdbd7d1..546a146068fa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +437,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_trusted_access_roles_operations.py index 4a95e7bb407c..03c45ee7db5e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/models/_models_py3.py index 4448c5e53ed3..7303b5aa8ad3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/models/_models_py3.py @@ -884,8 +884,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_10_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -922,8 +922,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_10_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1966,7 +1966,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2037,7 +2037,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5768,7 +5768,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5818,7 +5818,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_agent_pools_operations.py index 511b8ba207c2..2aa67dd1e5dc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -403,7 +408,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -617,7 +622,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +674,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +878,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -995,7 +1000,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1104,7 +1109,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_maintenance_configurations_operations.py index 17c43a526c00..16e875b33f00 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_managed_clusters_operations.py index 973d87f26335..9178b389d526 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1147,7 +1152,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1208,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1262,7 +1267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1349,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1424,7 +1429,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1489,7 +1494,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1552,7 +1557,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1689,7 +1694,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1798,7 +1803,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1998,7 +2003,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2190,7 +2195,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2294,7 +2299,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2485,7 +2490,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2552,7 +2557,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2583,7 +2588,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2612,7 +2617,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2676,7 +2681,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2781,7 +2786,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2890,7 +2895,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2994,7 +2999,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3100,7 +3105,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3207,7 +3212,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3430,7 +3435,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3507,7 +3512,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3591,7 +3596,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3669,7 +3674,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3736,7 +3741,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3819,7 +3824,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_operations.py index fd62f0c31741..46f6c0ccf33c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_private_endpoint_connections_operations.py index 8c14bd175b35..ed2a12666d9c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_private_link_resources_operations.py index 47f97a094684..b6caaec11c9a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_resolve_private_link_service_id_operations.py index 9b0ea41306df..a38592b4e300 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_snapshots_operations.py index da1269e520cb..a92e830afc2b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_trusted_access_role_bindings_operations.py index d258d42cb722..07350e7632d3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +633,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_trusted_access_roles_operations.py index 8268ed91d876..a5bc8dc909d6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_01/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -103,7 +108,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-10-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_agent_pools_operations.py index c0f182d444df..927db4224ce6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,6 +44,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +213,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +296,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +350,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -752,7 +757,7 @@ async def _delete_machines_initial( # pylint: disable=inconsistent-return-state machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +973,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1016,7 +1021,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_machines_operations.py index 46fca79c6cf3..6100198ff982 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._machines_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_maintenance_configurations_operations.py index e0123fe37325..6bd4a2024248 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 1c1f798c7bf0..47a129521e3f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_managed_clusters_operations.py index 191f74f921a0..3459b69a70ec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,6 +64,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,7 +109,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -162,7 +167,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -225,7 +230,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -311,7 +316,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -391,7 +396,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -442,7 +447,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -458,7 +463,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +528,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -598,7 +603,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -664,7 +669,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -725,7 +730,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -777,7 +782,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -982,7 +987,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1183,7 +1188,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1302,7 +1307,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1497,7 +1502,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1566,7 +1571,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1598,7 +1603,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1627,7 +1632,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1693,7 +1698,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1806,7 +1811,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1915,7 +1920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2023,7 +2028,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2133,7 +2138,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2244,7 +2249,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2472,7 +2477,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2553,7 +2558,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2633,7 +2638,7 @@ async def get_guardrails_versions( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2703,7 +2708,7 @@ def list_guardrails_versions( ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2788,7 +2793,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2866,7 +2871,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2937,7 +2942,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3020,7 +3025,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_operation_status_result_operations.py index b6940486bfca..b369a4e4b1a4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_operation_status_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,6 +35,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list( ) cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -235,7 +240,7 @@ async def get_by_agent_pool( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_operations.py index 2de6534f01b5..b3eef57bd7f1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_private_endpoint_connections_operations.py index 979575079765..e21ec7ebd65b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_private_link_resources_operations.py index a5d5fb286669..6c112d303651 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index e3028714ec35..da66b37e9c40 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_snapshots_operations.py index 71610dc73d35..54361e1b7c1c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 26f571de9645..b7d279755a1a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +445,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_trusted_access_roles_operations.py index 998e2cab660b..92a9a5756ae7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/models/_models_py3.py index 4fd3a18519cc..faf9524c4fd1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/models/_models_py3.py @@ -1136,8 +1136,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_10_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -1174,8 +1174,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_10_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2583,7 +2583,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2654,7 +2654,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -7493,7 +7493,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -7545,7 +7545,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_agent_pools_operations.py index 9affbe5b60f0..6a4ce6e415f3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -459,7 +464,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -597,7 +602,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -734,7 +739,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -948,7 +953,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1084,7 +1089,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1143,7 @@ def _delete_machines_initial( # pylint: disable=inconsistent-return-statements machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1354,7 +1359,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1402,7 +1407,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_machines_operations.py index ab0e2de3ae7e..6bca0267f4e1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +269,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_maintenance_configurations_operations.py index 4b408013196c..def702e7f49a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_managed_cluster_snapshots_operations.py index 30071ecc1e88..e0b15e497a31 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_managed_clusters_operations.py index 4047054920a3..0a93e80f3fe3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1215,7 +1220,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1273,7 +1278,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1336,7 +1341,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1420,7 +1425,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1500,7 +1505,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1551,7 +1556,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1567,7 +1572,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1632,7 +1637,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1707,7 +1712,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1773,7 +1778,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1834,7 +1839,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1886,7 +1891,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2091,7 +2096,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2292,7 +2297,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2411,7 +2416,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2606,7 +2611,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2675,7 +2680,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2707,7 +2712,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2736,7 +2741,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2802,7 +2807,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2915,7 +2920,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3024,7 +3029,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3132,7 +3137,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3242,7 +3247,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3353,7 +3358,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3581,7 +3586,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3662,7 +3667,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3740,7 +3745,7 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3808,7 +3813,7 @@ def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_m ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3893,7 +3898,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3971,7 +3976,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4042,7 +4047,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4125,7 +4130,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_operation_status_result_operations.py index 028c42b2fa3a..6990853eb554 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_operation_status_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -213,7 +218,7 @@ def list( ) cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +301,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +368,7 @@ def get_by_agent_pool( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_operations.py index 9f309eb904db..53f720614de7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_private_endpoint_connections_operations.py index 0ef3f90e3629..a5c8ba00c841 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_private_link_resources_operations.py index 6cbfc70faf54..4da4482c48b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_resolve_private_link_service_id_operations.py index ec6533deec49..9f93fdd56312 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_snapshots_operations.py index 624bf1a0d74f..7c6e9efec79a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_trusted_access_role_bindings_operations.py index efc0314e1477..3194b2ebec54 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -285,7 +290,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_10_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +427,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +641,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_trusted_access_roles_operations.py index 41ec08fbd073..8f2f5ca67fc8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_10_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_agent_pools_operations.py index 8d3fbd696116..1a6777fac071 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_maintenance_configurations_operations.py index 6e9fcea7d5cb..d77259b4ce5d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_managed_clusters_operations.py index 08d10cae2d28..6f88bf6385c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -61,6 +62,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,7 +107,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +222,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +386,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +435,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -446,7 +451,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +651,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -755,7 +760,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +960,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1442,7 +1447,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,7 +1514,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1540,7 +1545,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1569,7 +1574,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1633,7 +1638,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1738,7 +1743,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1847,7 +1852,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1951,7 +1956,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2164,7 +2169,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2387,7 +2392,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2464,7 +2469,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2548,7 +2553,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2626,7 +2631,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2693,7 +2698,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2776,7 +2781,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_operations.py index c8db0fa61916..816367adfcee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_private_endpoint_connections_operations.py index 776fa0f04cdc..e81afd96e67c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_private_link_resources_operations.py index a19b9ad60378..c53b802fb898 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_resolve_private_link_service_id_operations.py index 84c9419447af..ff25d186421a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_snapshots_operations.py index 55b1918e0a9b..a5a7b671a337 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_trusted_access_role_bindings_operations.py index ae7191704eed..6f3467ae1387 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +437,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_trusted_access_roles_operations.py index e41c118558bc..94c1e6ca2ec4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/models/_models_py3.py index ebaae107543d..38a178962f2c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/models/_models_py3.py @@ -900,8 +900,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_11_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -938,8 +938,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_11_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1982,7 +1982,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2053,7 +2053,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5784,7 +5784,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5834,7 +5834,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_agent_pools_operations.py index d2444a5df14c..9714ddc3ef29 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -403,7 +408,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -617,7 +622,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +674,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +878,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -995,7 +1000,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1104,7 +1109,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_maintenance_configurations_operations.py index 9ed387735e55..2eb314593094 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_managed_clusters_operations.py index 5eb85e602b84..f6c18a16b3a6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1147,7 +1152,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1208,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1262,7 +1267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1349,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1424,7 +1429,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1489,7 +1494,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1552,7 +1557,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1689,7 +1694,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1798,7 +1803,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1998,7 +2003,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2190,7 +2195,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2294,7 +2299,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2485,7 +2490,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2552,7 +2557,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2583,7 +2588,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2612,7 +2617,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2676,7 +2681,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2781,7 +2786,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2890,7 +2895,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2994,7 +2999,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3100,7 +3105,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3207,7 +3212,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3430,7 +3435,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3507,7 +3512,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3591,7 +3596,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3669,7 +3674,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3736,7 +3741,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3819,7 +3824,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_operations.py index 81a3bb4cda95..d9fd55d65b00 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_private_endpoint_connections_operations.py index 8dc17654fb9c..e6c2c97c2cdf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_private_link_resources_operations.py index 177a6795c791..6e43631db5c6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_resolve_private_link_service_id_operations.py index 38df3297b5fb..1fe7cfa09012 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_snapshots_operations.py index 3bfd14047ab8..24ce0a9b8ab2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_trusted_access_role_bindings_operations.py index 445dcd7eac86..f69b30cd5891 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +633,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_trusted_access_roles_operations.py index 42f11ceca95b..30fde6259852 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_01/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -103,7 +108,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2023-11-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_agent_pools_operations.py index 5e2ef61499f0..8f1f4de30881 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,6 +44,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +213,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +296,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +350,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -752,7 +757,7 @@ async def _delete_machines_initial( # pylint: disable=inconsistent-return-state machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +973,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1016,7 +1021,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_machines_operations.py index b1d30056965b..3f966dd75384 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._machines_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_maintenance_configurations_operations.py index fa719e0c3ae9..38ba0210167a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index ea530e7ceaf7..c701c32cf672 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_managed_clusters_operations.py index 1f77faec5dc0..35dc8521ff70 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -65,6 +66,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -106,7 +111,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +169,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +232,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +318,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +398,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +449,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -460,7 +465,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -666,7 +671,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -779,7 +784,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -984,7 +989,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1304,7 +1309,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1499,7 +1504,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1568,7 +1573,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1600,7 +1605,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1695,7 +1700,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1808,7 +1813,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1917,7 +1922,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2025,7 +2030,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2135,7 +2140,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2246,7 +2251,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2474,7 +2479,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2555,7 +2560,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2635,7 +2640,7 @@ async def get_guardrails_versions( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2705,7 +2710,7 @@ def list_guardrails_versions( ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2784,7 +2789,7 @@ async def get_safeguards_versions( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.SafeguardsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2854,7 +2859,7 @@ def list_safeguards_versions( ) cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2939,7 +2944,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3017,7 +3022,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3088,7 +3093,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3171,7 +3176,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_operation_status_result_operations.py index 1f341fc81999..afe8e767a270 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_operation_status_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,6 +35,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list( ) cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -235,7 +240,7 @@ async def get_by_agent_pool( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_operations.py index 525ac0ba40f9..5504521f065d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_private_endpoint_connections_operations.py index b337a158fe0b..73b8e5b5a90e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_private_link_resources_operations.py index 163b57bc188b..e45e7c64e4bf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index c8f175ef8c11..da67024ecdd5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_snapshots_operations.py index ac10b5038cf8..edd7702d6c82 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index 01189659842e..1845f2943b0e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +445,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_trusted_access_roles_operations.py index 081c14a7452f..e0401c62bc8f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/models/_models_py3.py index 2fd3a1420a86..a7cab469a845 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/models/_models_py3.py @@ -1163,8 +1163,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_11_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -1201,8 +1201,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2023_11_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2553,7 +2553,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2624,7 +2624,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -7463,7 +7463,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -7515,7 +7515,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_agent_pools_operations.py index 5a68c3e3df3c..e0118bf06c86 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -459,7 +464,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -597,7 +602,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -734,7 +739,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -948,7 +953,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1084,7 +1089,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1143,7 @@ def _delete_machines_initial( # pylint: disable=inconsistent-return-statements machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1354,7 +1359,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1402,7 +1407,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_machines_operations.py index 3a22f515633c..6556b6de0d4e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +269,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_maintenance_configurations_operations.py index bdd31508421e..0ce6d2903811 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_managed_cluster_snapshots_operations.py index 5128a3a59a66..08ad0c13e338 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_managed_clusters_operations.py index 167c83b9d66f..79bc3efed808 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1274,7 +1279,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1395,7 +1400,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1484,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1559,7 +1564,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1610,7 +1615,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1626,7 +1631,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1691,7 +1696,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1766,7 +1771,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1832,7 +1837,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1893,7 +1898,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1945,7 +1950,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2150,7 +2155,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2351,7 +2356,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2470,7 +2475,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2665,7 +2670,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2734,7 +2739,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2766,7 +2771,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2795,7 +2800,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2861,7 +2866,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2974,7 +2979,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3083,7 +3088,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3191,7 +3196,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3301,7 +3306,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3412,7 +3417,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3640,7 +3645,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3721,7 +3726,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3799,7 +3804,7 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3867,7 +3872,7 @@ def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_m ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3944,7 +3949,7 @@ def get_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.SafeguardsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4012,7 +4017,7 @@ def list_safeguards_versions(self, location: str, **kwargs: Any) -> Iterable["_m ) cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4097,7 +4102,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4175,7 +4180,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4246,7 +4251,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4329,7 +4334,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_operation_status_result_operations.py index 95e4bde6bb43..2359f2d36a3a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_operation_status_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -213,7 +218,7 @@ def list( ) cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +301,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +368,7 @@ def get_by_agent_pool( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_operations.py index 29f7bde76301..611fb4f28795 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_private_endpoint_connections_operations.py index 5fe10d4a7756..e4d335a605d7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_private_link_resources_operations.py index de78c91a116d..66bad96123fb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_resolve_private_link_service_id_operations.py index 2112ff952314..0115f5716df6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_snapshots_operations.py index 85309fcfbdcf..dea1a731d45b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_trusted_access_role_bindings_operations.py index 8cddecffcf6b..943fe6741de9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -285,7 +290,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2023_11_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +427,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +641,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_trusted_access_roles_operations.py index ba2c4179e149..ce915486e51e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2023_11_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_agent_pools_operations.py index 1bcc17ffe7b1..4e3c4509e4a4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_maintenance_configurations_operations.py index 349c62f568c2..aa6664011af6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_managed_clusters_operations.py index b809e1c5cf5e..32f994fd9fa8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -61,6 +62,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,7 +107,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +222,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +386,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +435,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -446,7 +451,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +651,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -755,7 +760,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +960,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1442,7 +1447,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,7 +1514,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1540,7 +1545,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1569,7 +1574,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1633,7 +1638,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1738,7 +1743,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1847,7 +1852,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1951,7 +1956,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2164,7 +2169,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2387,7 +2392,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2464,7 +2469,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2548,7 +2553,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2626,7 +2631,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2693,7 +2698,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2776,7 +2781,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_operations.py index fb9f899ead91..2d828fb13f89 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_private_endpoint_connections_operations.py index 31a94d7e8507..c42041f59f8b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_private_link_resources_operations.py index df8560f846d8..d959f18e3ed2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_resolve_private_link_service_id_operations.py index 37b39c312ce5..f940bff2e008 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_snapshots_operations.py index c6f2c0743316..866cc6479c41 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_trusted_access_role_bindings_operations.py index 9db5c043efc9..f0b5e80c9a9e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +437,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_trusted_access_roles_operations.py index c4511bbc2aa5..7aaffa372383 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/models/_models_py3.py index b5f46838ebe0..608fd0631821 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/models/_models_py3.py @@ -900,8 +900,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2024_01_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -938,8 +938,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2024_01_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -1982,7 +1982,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2053,7 +2053,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5870,7 +5870,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -5920,7 +5920,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_agent_pools_operations.py index 9825ebe77a6a..bdc0da9b3457 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -403,7 +408,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -617,7 +622,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +674,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +878,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -995,7 +1000,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1104,7 +1109,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_maintenance_configurations_operations.py index c352a1b3f2d9..51da3fed5436 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_managed_clusters_operations.py index 13d1e0d34006..c8e60b792a9b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1147,7 +1152,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1208,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1262,7 +1267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1349,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1424,7 +1429,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1489,7 +1494,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1552,7 +1557,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1689,7 +1694,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1798,7 +1803,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1998,7 +2003,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2190,7 +2195,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2294,7 +2299,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2485,7 +2490,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2552,7 +2557,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2583,7 +2588,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2612,7 +2617,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2676,7 +2681,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2781,7 +2786,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2890,7 +2895,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2994,7 +2999,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3100,7 +3105,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3207,7 +3212,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3430,7 +3435,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3507,7 +3512,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3591,7 +3596,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3669,7 +3674,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3736,7 +3741,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3819,7 +3824,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_operations.py index 33e2a82e8e5f..7e507364d9a9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_private_endpoint_connections_operations.py index 3a9b5fea9351..f57216e39367 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_private_link_resources_operations.py index 80032ca98921..4683127c5007 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_resolve_private_link_service_id_operations.py index d2620782f0ec..68955385c14d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_snapshots_operations.py index 43c1dfc7928d..7fdb3f37ba10 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_trusted_access_role_bindings_operations.py index 5811b378f69f..2085fe7614a5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +633,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_trusted_access_roles_operations.py index 150ccc79ce53..e24a389d60dc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_01/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -103,7 +108,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-01-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_agent_pools_operations.py index c8f6a61204d7..4a1ca9ad5e8e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,6 +44,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -208,7 +213,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -291,7 +296,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -345,7 +350,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -562,7 +567,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -698,7 +703,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -752,7 +757,7 @@ async def _delete_machines_initial( # pylint: disable=inconsistent-return-state machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +973,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1016,7 +1021,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_machines_operations.py index 9038a1b3b8f5..1add4fd2ac76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,6 +31,10 @@ from ..._vendor import _convert_request from ...operations._machines_operations import build_get_request, build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_maintenance_configurations_operations.py index 58632e3a9800..566f961097f2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,7 +314,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -390,7 +395,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py index 4d21a1479fe8..5b86a8c4b224 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +174,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +252,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -376,7 +381,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -522,7 +527,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -596,7 +601,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_managed_clusters_operations.py index eeebcf620d33..2d84069c5af8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -65,6 +66,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -106,7 +111,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -164,7 +169,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -227,7 +232,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -313,7 +318,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +398,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -444,7 +449,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -460,7 +465,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -525,7 +530,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -600,7 +605,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -666,7 +671,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -779,7 +784,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -984,7 +989,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1185,7 +1190,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1304,7 +1309,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1499,7 +1504,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1568,7 +1573,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1600,7 +1605,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1629,7 +1634,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1695,7 +1700,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1808,7 +1813,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1917,7 +1922,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2025,7 +2030,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2135,7 +2140,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2246,7 +2251,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2474,7 +2479,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2555,7 +2560,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2635,7 +2640,7 @@ async def get_guardrails_versions( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2705,7 +2710,7 @@ def list_guardrails_versions( ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2784,7 +2789,7 @@ async def get_safeguards_versions( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.SafeguardsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2854,7 +2859,7 @@ def list_safeguards_versions( ) cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2939,7 +2944,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3017,7 +3022,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3088,7 +3093,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3171,7 +3176,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_operation_status_result_operations.py index f9f75f1d2adc..ae7a932412b1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_operation_status_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,6 +35,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list( ) cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -235,7 +240,7 @@ async def get_by_agent_pool( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_operations.py index fbf3a83f3b9b..92a9236ae609 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_private_endpoint_connections_operations.py index 2e790ccb133b..a0536c22d906 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +83,7 @@ async def list( ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -143,7 +148,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -282,7 +287,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -347,7 +352,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_private_link_resources_operations.py index 9187070e885a..856724b90bc9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py index 315f69325001..daecd84e4b80 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_snapshots_operations.py index 4cd0b2e8ecf5..ce11f69aed91 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +170,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +248,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -370,7 +375,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -514,7 +519,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -588,7 +593,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py index a34ad47d2ecc..129a9c64940c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +94,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +177,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -226,7 +231,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -440,7 +445,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_trusted_access_roles_operations.py index a59a35fe493d..a4b48d5cbeb3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/models/_models_py3.py index d367d9636f53..c3393b12d0ed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/models/_models_py3.py @@ -1176,8 +1176,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2024_01_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -1214,8 +1214,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2024_01_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2566,7 +2566,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2637,7 +2637,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -7549,7 +7549,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -7601,7 +7601,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_agent_pools_operations.py index ed722911818a..1e3971d0b4ba 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -459,7 +464,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -597,7 +602,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I ) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -680,7 +685,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -734,7 +739,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -948,7 +953,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1084,7 +1089,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1138,7 +1143,7 @@ def _delete_machines_initial( # pylint: disable=inconsistent-return-statements machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1354,7 +1359,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1402,7 +1407,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_machines_operations.py index 721bbf7e8ade..ffddd9a49973 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_machines_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -178,7 +183,7 @@ def list( ) cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -264,7 +269,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.Machine :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_maintenance_configurations_operations.py index 019649d6e4ad..a82a4bdf5f46 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +255,7 @@ def list_by_managed_cluster( ) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +338,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +477,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -553,7 +558,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_managed_cluster_snapshots_operations.py index 4a2eb2f68a70..7300bf737e99 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -297,7 +302,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -384,7 +389,7 @@ def list_by_resource_group( ) cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -462,7 +467,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -591,7 +596,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +742,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +816,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_managed_clusters_operations.py index fdd11cca347c..218cbd252893 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1274,7 +1279,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1332,7 +1337,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1395,7 +1400,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1479,7 +1484,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1559,7 +1564,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1610,7 +1615,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1626,7 +1631,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1691,7 +1696,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1766,7 +1771,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1832,7 +1837,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1893,7 +1898,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1945,7 +1950,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2150,7 +2155,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2351,7 +2356,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2470,7 +2475,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2665,7 +2670,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2734,7 +2739,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2766,7 +2771,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2795,7 +2800,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2861,7 +2866,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2974,7 +2979,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3083,7 +3088,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3191,7 +3196,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3301,7 +3306,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3412,7 +3417,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3640,7 +3645,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3721,7 +3726,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo ) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3799,7 +3804,7 @@ def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.GuardrailsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3867,7 +3872,7 @@ def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_m ) cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3944,7 +3949,7 @@ def get_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.SafeguardsAvailableVersion :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4012,7 +4017,7 @@ def list_safeguards_versions(self, location: str, **kwargs: Any) -> Iterable["_m ) cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4097,7 +4102,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ ) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4175,7 +4180,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4246,7 +4251,7 @@ def list_mesh_upgrade_profiles( ) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -4329,7 +4334,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_operation_status_result_operations.py index b2724c0f2abe..ca62a55a06c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_operation_status_result_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -213,7 +218,7 @@ def list( ) cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +301,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +368,7 @@ def get_by_agent_pool( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.OperationStatusResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_operations.py index 88305234474c..593ce41c5b19 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -94,7 +99,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: ) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_private_endpoint_connections_operations.py index 4dc39319fcad..7152b877e747 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -260,7 +265,7 @@ def list( ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -325,7 +330,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +469,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -529,7 +534,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_private_link_resources_operations.py index 50c685ca587e..40e46ac83ef1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_resolve_private_link_service_id_operations.py index 88bbf7be293e..e8e0cb04d4fb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_snapshots_operations.py index 4b387d93aaaa..2617f5f00edc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -294,7 +299,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +383,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite ) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -456,7 +461,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -583,7 +588,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +732,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -801,7 +806,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_trusted_access_role_bindings_operations.py index a1c243323818..d354c4f7b683 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -285,7 +290,7 @@ def list( ) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -368,7 +373,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_01_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -422,7 +427,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -636,7 +641,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_trusted_access_roles_operations.py index be16395da6ee..5307be8debe1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_01_02_preview/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -105,7 +110,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR ) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/_version.py index 215f19d5391f..e5754a47ce68 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "30.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_agent_pools_operations.py index 90c2e833ac0b..565a18629b77 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,10 @@ build_upgrade_node_image_version_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ def __init__(self, *args, **kwargs) -> None: async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -201,7 +206,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -284,7 +289,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +341,7 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -543,7 +548,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +670,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -728,7 +733,7 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -774,7 +779,7 @@ async def get_available_agent_pool_versions( async def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_maintenance_configurations_operations.py index 53a660f7912e..f512b6984013 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,10 @@ build_list_by_managed_cluster_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +90,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +173,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -304,7 +309,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +388,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_managed_clusters_operations.py index 34d7f4322f3a..51f0c7463e7e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -61,6 +62,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,7 +107,7 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -158,7 +163,7 @@ async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _model :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +222,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -301,7 +306,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -381,7 +386,7 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -430,7 +435,7 @@ async def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -446,7 +451,7 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -509,7 +514,7 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -582,7 +587,7 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -646,7 +651,7 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -705,7 +710,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -755,7 +760,7 @@ async def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -955,7 +960,7 @@ async def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1147,7 +1152,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1251,7 +1256,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1442,7 +1447,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,7 +1514,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1540,7 +1545,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1569,7 +1574,7 @@ async def begin_reset_aad_profile( ) -> AsyncLROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -1633,7 +1638,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1738,7 +1743,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1847,7 +1852,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1951,7 +1956,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2057,7 +2062,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2164,7 +2169,7 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2387,7 +2392,7 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2464,7 +2469,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2548,7 +2553,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIter api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2626,7 +2631,7 @@ async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: An :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2693,7 +2698,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2776,7 +2781,7 @@ async def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_operations.py index e0ac2f72cc29..288ddf8de46b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_private_endpoint_connections_operations.py index 5474c9d3dee5..5c9e10acc733 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,6 +36,10 @@ build_update_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +82,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -140,7 +145,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -276,7 +281,7 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -339,7 +344,7 @@ async def update( async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_private_link_resources_operations.py index 708292355a98..97e6ab2d1bdb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +74,7 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_resolve_private_link_service_id_operations.py index 210f70949860..af1bbebb96e9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -135,7 +140,7 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_snapshots_operations.py index b7618be0e635..22b6c17c203a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_update_tags_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -161,7 +166,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -239,7 +244,7 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +369,7 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -505,7 +510,7 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +582,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_trusted_access_role_bindings_operations.py index 9c247f4e328d..a4e1d38c88ee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,6 +39,10 @@ build_list_request, ) +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +92,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +175,7 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -222,7 +227,7 @@ async def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -432,7 +437,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_trusted_access_roles_operations.py index 5edc4a208e35..d2a71e875195 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/aio/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +77,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/models/_models_py3.py index 84edf847c17b..349c39062847 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/models/_models_py3.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/models/_models_py3.py @@ -933,8 +933,8 @@ class AzureKeyVaultKms(_serialization.Model): :vartype key_vault_network_access: str or ~azure.mgmt.containerservice.v2024_02_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :vartype key_vault_resource_id: str """ @@ -971,8 +971,8 @@ def __init__( :paramtype key_vault_network_access: str or ~azure.mgmt.containerservice.v2024_02_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. + ``Private``\\ , this field is required and must be a valid resource ID. When + keyVaultNetworkAccess is ``Public``\\ , leave the field empty. :paramtype key_vault_resource_id: str """ super().__init__(**kwargs) @@ -2009,7 +2009,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :vartype topology_manager_policy: str :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending - in ``*``\ ). + in ``*``\\ ). :vartype allowed_unsafe_sysctls: list[str] :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -2080,7 +2080,7 @@ def __init__( 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. :paramtype topology_manager_policy: str :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns - (ending in ``*``\ ). + (ending in ``*``\\ ). :paramtype allowed_unsafe_sysctls: list[str] :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on the node. @@ -5979,7 +5979,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :vartype admin_password: str @@ -6029,7 +6029,7 @@ def __init__( :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper - characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\W_]) + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". :paramtype admin_password: str diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_agent_pools_operations.py index ecd3681bdd95..7e51551d2dc4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_agent_pools_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -403,7 +408,7 @@ def __init__(self, *args, **kwargs): def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +539,7 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -617,7 +622,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -669,7 +674,7 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO[bytes]], **kwargs: Any ) -> _models.AgentPool: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -873,7 +878,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -995,7 +1000,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1058,7 +1063,7 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1104,7 +1109,7 @@ def get_available_agent_pool_versions( def _upgrade_node_image_version_initial( self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_maintenance_configurations_operations.py index 59b67e36260e..d3defe68fae7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_maintenance_configurations_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -248,7 +253,7 @@ def list_by_managed_cluster( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +336,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -467,7 +472,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +551,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_managed_clusters_operations.py index 3b4691adb24f..a556c82c2f7f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_managed_clusters_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -1147,7 +1152,7 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1203,7 +1208,7 @@ def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.Kube :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.KubernetesVersionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1262,7 +1267,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1344,7 +1349,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1424,7 +1429,7 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1473,7 +1478,7 @@ def get_access_profile( ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Instead use `ListClusterUserCredentials + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials `_ or `ListClusterAdminCredentials `_ . @@ -1489,7 +1494,7 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1552,7 +1557,7 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1625,7 +1630,7 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1689,7 +1694,7 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1748,7 +1753,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.ManagedCluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1798,7 +1803,7 @@ def _create_or_update_initial( parameters: Union[_models.ManagedCluster, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1998,7 +2003,7 @@ def _update_tags_initial( parameters: Union[_models.TagsObject, IO[bytes]], **kwargs: Any ) -> _models.ManagedCluster: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2190,7 +2195,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2294,7 +2299,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2485,7 +2490,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2552,7 +2557,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2583,7 +2588,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2612,7 +2617,7 @@ def begin_reset_aad_profile( ) -> LROPoller[None]: """Reset the AAD Profile of a managed cluster. - **WARNING**\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory integration `_ to update your cluster with AKS-managed Azure AD. @@ -2676,7 +2681,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2781,7 +2786,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2890,7 +2895,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -2994,7 +2999,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3100,7 +3105,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _start_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3207,7 +3212,7 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO[bytes]], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3430,7 +3435,7 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3507,7 +3512,7 @@ def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3591,7 +3596,7 @@ def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable[ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3669,7 +3674,7 @@ def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.MeshRevisionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3736,7 +3741,7 @@ def list_mesh_upgrade_profiles( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -3819,7 +3824,7 @@ def get_mesh_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.MeshUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_operations.py index 0fa52a2933a4..c1b60feaaf0a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +97,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_private_endpoint_connections_operations.py index 6160757f02b9..de4db78d7871 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_private_endpoint_connections_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -259,7 +264,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +327,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -458,7 +463,7 @@ def update( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -521,7 +526,7 @@ def update( def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_private_link_resources_operations.py index 03c51238f077..a2ce3ea1f854 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_private_link_resources_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,6 +28,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -112,7 +117,7 @@ def list( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_resolve_private_link_service_id_operations.py index f9e158f41b60..1612b0bdafb4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_resolve_private_link_service_id_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -28,6 +29,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -181,7 +186,7 @@ def post( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_snapshots_operations.py index ab8eedcb7932..b0469652627c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_snapshots_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -30,6 +31,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -291,7 +296,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -372,7 +377,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -450,7 +455,7 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -575,7 +580,7 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -716,7 +721,7 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -788,7 +793,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_trusted_access_role_bindings_operations.py index c9d559684622..cbb758d59d69 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_trusted_access_role_bindings_operations.py @@ -7,7 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from io import IOBase -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -32,6 +33,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -283,7 +288,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -366,7 +371,7 @@ def get( :rtype: ~azure.mgmt.containerservice.v2024_02_01.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -418,7 +423,7 @@ def _create_or_update_initial( trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], **kwargs: Any ) -> _models.TrustedAccessRoleBinding: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -628,7 +633,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_trusted_access_roles_operations.py index 8f15b48fbbbd..1a864af3d02a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_01/operations/_trusted_access_roles_operations.py @@ -6,7 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -103,7 +108,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._api_version or "2024-02-01")) cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - error_map = { + error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/__init__.py new file mode 100644 index 000000000000..4f004a298ed4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/__init__.py @@ -0,0 +1,26 @@ +# 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 ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_configuration.py new file mode 100644 index 000000000000..a7ca1278b2f9 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ContainerServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + :keyword api_version: Api Version. Default value is "2024-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", "2024-02-02-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_container_service_client.py new file mode 100644 index 000000000000..32dd9b1d237a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_container_service_client.py @@ -0,0 +1,199 @@ +# 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 copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy + +from . import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientConfiguration +from .operations import ( + AgentPoolsOperations, + MachinesOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + OperationStatusResultOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + ResolvePrivateLinkServiceIdOperations, + SnapshotsOperations, + TrustedAccessRoleBindingsOperations, + TrustedAccessRolesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2024_02_02_preview.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2024_02_02_preview.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2024_02_02_preview.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2024_02_02_preview.operations.AgentPoolsOperations + :ivar machines: MachinesOperations operations + :vartype machines: + azure.mgmt.containerservice.v2024_02_02_preview.operations.MachinesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2024_02_02_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2024_02_02_preview.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2024_02_02_preview.operations.ResolvePrivateLinkServiceIdOperations + :ivar operation_status_result: OperationStatusResultOperations operations + :vartype operation_status_result: + azure.mgmt.containerservice.v2024_02_02_preview.operations.OperationStatusResultOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2024_02_02_preview.operations.SnapshotsOperations + :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations + :vartype managed_cluster_snapshots: + azure.mgmt.containerservice.v2024_02_02_preview.operations.ManagedClusterSnapshotsOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.v2024_02_02_preview.operations.TrustedAccessRolesOperations + :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations + :vartype trusted_access_role_bindings: + azure.mgmt.containerservice.v2024_02_02_preview.operations.TrustedAccessRoleBindingsOperations + :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". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-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 + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + 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) + + 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, "2024-02-02-preview" + ) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.machines = MachinesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.operation_status_result = OperationStatusResultOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "ContainerServiceClient": + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_metadata.json new file mode 100644 index 000000000000..5fcf5fbded45 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_metadata.json @@ -0,0 +1,122 @@ +{ + "chosen_version": "2024-02-02-preview", + "total_api_version_list": ["2024-02-02-preview"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "host_value": "\"https://management.azure.com\"", + "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\"]}}, \"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\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true, + "method_location": "positional" + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. The value must be an UUID. Required.", + "docstring_type": "str", + "required": true, + "method_location": "positional" + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. The value must be an UUID. Required.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version: Optional[str]=None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles=KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "maintenance_configurations": "MaintenanceConfigurationsOperations", + "agent_pools": "AgentPoolsOperations", + "machines": "MachinesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations", + "operation_status_result": "OperationStatusResultOperations", + "snapshots": "SnapshotsOperations", + "managed_cluster_snapshots": "ManagedClusterSnapshotsOperations", + "trusted_access_roles": "TrustedAccessRolesOperations", + "trusted_access_role_bindings": "TrustedAccessRoleBindingsOperations" + } +} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_02_02_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_vendor.py new file mode 100644 index 000000000000..0dafe0e287ff --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_vendor.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/__init__.py new file mode 100644 index 000000000000..d14e96ddb36e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/__init__.py @@ -0,0 +1,23 @@ +# 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 ._container_service_client import ContainerServiceClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_configuration.py new file mode 100644 index 000000000000..aa4ae90f61a2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ContainerServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + :keyword api_version: Api Version. Default value is "2024-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", "2024-02-02-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_container_service_client.py new file mode 100644 index 000000000000..090f3072f486 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_container_service_client.py @@ -0,0 +1,201 @@ +# 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 copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy + +from .. import models as _models +from ..._serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientConfiguration +from .operations import ( + AgentPoolsOperations, + MachinesOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + OperationStatusResultOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + ResolvePrivateLinkServiceIdOperations, + SnapshotsOperations, + TrustedAccessRoleBindingsOperations, + TrustedAccessRolesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.AgentPoolsOperations + :ivar machines: MachinesOperations operations + :vartype machines: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.MachinesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.ResolvePrivateLinkServiceIdOperations + :ivar operation_status_result: OperationStatusResultOperations operations + :vartype operation_status_result: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.OperationStatusResultOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.SnapshotsOperations + :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations + :vartype managed_cluster_snapshots: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.ManagedClusterSnapshotsOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.TrustedAccessRolesOperations + :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations + :vartype trusted_access_role_bindings: + azure.mgmt.containerservice.v2024_02_02_preview.aio.operations.TrustedAccessRoleBindingsOperations + :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". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-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 + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + 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) + + 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, "2024-02-02-preview" + ) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.machines = MachinesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.operation_status_result = OperationStatusResultOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-02-02-preview" + ) + + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ContainerServiceClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_02_02_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..a035074bb195 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/__init__.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._machines_operations import MachinesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._operation_status_result_operations import OperationStatusResultOperations +from ._snapshots_operations import SnapshotsOperations +from ._managed_cluster_snapshots_operations import ManagedClusterSnapshotsOperations +from ._trusted_access_roles_operations import TrustedAccessRolesOperations +from ._trusted_access_role_bindings_operations import TrustedAccessRoleBindingsOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "MachinesOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "OperationStatusResultOperations", + "SnapshotsOperations", + "ManagedClusterSnapshotsOperations", + "TrustedAccessRolesOperations", + "TrustedAccessRoleBindingsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..fe5c44a3227b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_agent_pools_operations.py @@ -0,0 +1,1152 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import ( + build_abort_latest_operation_request, + build_create_or_update_request, + build_delete_machines_request, + build_delete_request, + build_get_available_agent_pool_versions_request, + build_get_request, + build_get_upgrade_profile_request, + build_list_request, + build_upgrade_node_image_version_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class AgentPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`agent_pools` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Aborts last operation running on agent pool. + + Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + completes before cancellation can take place, an error is returned. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_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 "2024-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable["_models.AgentPool"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AgentPoolListResult", 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, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPool: + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :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 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.v2024_02_02_preview.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPool", pipeline_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, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + **kwargs: Any + ) -> _models.AgentPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentPool] = 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, "AgentPool") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AgentPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AgentPool", pipeline_response) + + 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, + agent_pool_name: str, + parameters: _models.AgentPool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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.v2024_02_02_preview.models.AgentPool + :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 AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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: 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 AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_02_02_preview.models.AgentPool or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + 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) + 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, + agent_pool_name=agent_pool_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AgentPool", pipeline_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.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 "2024-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + @distributed_trace_async + async def get_upgrade_profile( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPoolUpgradeProfile: + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :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 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.v2024_02_02_preview.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_machines_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(machines, (IOBase, bytes)): + _content = machines + else: + _json = self._serialize.body(machines, "AgentPoolDeleteMachinesParameter") + + _request = build_delete_machines_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: _models.AgentPoolDeleteMachinesParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: + ~azure.mgmt.containerservice.v2024_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 + :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: + """ + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_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] + :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 "2024-02-02-preview") + ) + 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) + 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_machines_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machines=machines, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 + + @distributed_trace_async + async def get_available_agent_pool_versions( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.AgentPoolAvailableVersions: + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :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: AgentPoolAvailableVersions or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) + + _request = build_get_available_agent_pool_versions_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _upgrade_node_image_version_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Optional[_models.AgentPool]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[Optional[_models.AgentPool]] = kwargs.pop("cls", None) + + _request = build_upgrade_node_image_version_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_upgrade_node_image_version( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_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 "2024-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._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_machines_operations.py new file mode 100644 index 000000000000..b61ff229b7ec --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_machines_operations.py @@ -0,0 +1,221 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._machines_operations import build_get_request, build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`machines` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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, agent_pool_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Machine"]: + """Gets a list of machines in the specified agent pool. + + Gets a list of machines in the specified agent pool. + + :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 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.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MachineListResult", 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, agent_pool_name: str, machine_name: str, **kwargs: Any + ) -> _models.Machine: + """Get a specific machine in the specified agent pool. + + Get a specific machine in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_02_02_preview.models.Machine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Machine", pipeline_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/v2024_02_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..72989f7b3936 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -0,0 +1,438 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_managed_cluster_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`maintenance_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations 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 MaintenanceConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationListResult", 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, config_name: str, **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration 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 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.v2024_02_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: _models.MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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.v2024_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.v2024_02_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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: 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: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: Union[_models.MaintenanceConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 config_name: The name of the maintenance configuration. Required. + :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.v2024_02_02_preview.models.MaintenanceConfiguration or IO[bytes] + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceConfiguration] = 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, "MaintenanceConfiguration") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :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 config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py new file mode 100644 index 000000000000..673bc83bad82 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -0,0 +1,643 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._managed_cluster_snapshots_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ManagedClusterSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`managed_cluster_snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of managed cluster snapshots in the specified subscription. + + Gets a list of managed cluster snapshots in the specified subscription. + + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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 + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ManagedClusterSnapshot"]: + """Lists managed cluster snapshots in the specified subscription and resource group. + + Lists managed cluster snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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, **kwargs: Any) -> _models.ManagedClusterSnapshot: + """Gets a managed cluster snapshot. + + Gets a managed cluster snapshot. + + :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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterSnapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot to create or update. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterSnapshot, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 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.v2024_02_02_preview.models.ManagedClusterSnapshot or IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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, "ManagedClusterSnapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 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.v2024_02_02_preview.models.TagsObject or + IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a managed cluster snapshot. + + Deletes a managed cluster snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..7494e18ee776 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,3223 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import ( + build_abort_latest_operation_request, + build_create_or_update_request, + build_delete_request, + build_get_access_profile_request, + build_get_command_result_request, + build_get_guardrails_versions_request, + build_get_mesh_revision_profile_request, + build_get_mesh_upgrade_profile_request, + build_get_os_options_request, + build_get_request, + build_get_safeguards_versions_request, + build_get_upgrade_profile_request, + build_list_by_resource_group_request, + build_list_cluster_admin_credentials_request, + build_list_cluster_monitoring_user_credentials_request, + build_list_cluster_user_credentials_request, + build_list_guardrails_versions_request, + build_list_kubernetes_versions_request, + build_list_mesh_revision_profiles_request, + build_list_mesh_upgrade_profiles_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_request, + build_list_safeguards_versions_request, + build_reset_aad_profile_request, + build_reset_service_principal_profile_request, + build_rotate_cluster_certificates_request, + build_rotate_service_account_signing_keys_request, + build_run_command_request, + build_start_request, + build_stop_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ManagedClustersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`managed_clusters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get_os_options( + self, location: str, resource_type: Optional[str] = None, **kwargs: Any + ) -> _models.OSOptionProfile: + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. Default + value is None. + :type resource_type: str + :return: OSOptionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.OSOptionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.OSOptionProfile] = kwargs.pop("cls", None) + + _request = build_get_os_options_request( + location=location, + subscription_id=self._config.subscription_id, + resource_type=resource_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OSOptionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: + """Gets a list of supported Kubernetes versions in the specified subscription. + + Contains extra metadata on the version, including supported patch versions, capabilities, + available upgrades, and details on preview status of the version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: KubernetesVersionListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.KubernetesVersionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) + + _request = build_list_kubernetes_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("KubernetesVersionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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 + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ManagedCluster"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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_upgrade_profile( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.ManagedClusterUpgradeProfile: + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile 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 + :return: ManagedClusterUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_access_profile( + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any + ) -> _models.ManagedClusterAccessProfile: + """Gets an access profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :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 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.v2024_02_02_preview.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) + + _request = build_get_access_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_admin_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials 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 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.v2024_02_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_admin_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any + ) -> _models.CredentialResults: + """Lists the user credentials of a managed cluster. + + Lists the user credentials 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :type server_fqdn: str + :param format: Only apply to AAD clusters, specifies the format of returned kubeconfig. Format + '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" and "exec". + Default value is None. + :type format: str or ~azure.mgmt.containerservice.v2024_02_02_preview.models.Format + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + format=format, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_monitoring_user_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials 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 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.v2024_02_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_monitoring_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: + """Gets a managed cluster. + + Gets 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 + :return: ManagedCluster or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_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, + parameters: Union[_models.ManagedCluster, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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, "ManagedCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + 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, + parameters: _models.ManagedCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster 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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedCluster, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Is either a ManagedCluster type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + 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) + 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, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. 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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 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.v2024_02_02_preview.models.TagsObject or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + 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) + 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._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes 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 ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 "2024-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + async def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterServicePrincipalProfile") + + _request = build_reset_service_principal_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterServicePrincipalProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_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 + :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: + """ + + @overload + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 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.v2024_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] + :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 "2024-02-02-preview") + ) + 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) + 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._reset_service_principal_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterAADProfile") + + _request = build_reset_aad_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterAADProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_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 + :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: + """ + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 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.v2024_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: + """ + _headers = case_insensitive_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 "2024-02-02-preview") + ) + 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) + 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._reset_aad_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Aborts last operation running on managed cluster. + + Aborts the currently running operation on the managed cluster. The Managed Cluster will be + moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If + the operation completes before cancellation can take place, an error is returned. + + :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 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 "2024-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_cluster_certificates_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_rotate_cluster_certificates( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :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 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 "2024-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._rotate_cluster_certificates_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_service_account_signing_keys_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the service account signing keys of a managed cluster. + + Rotates the service account signing keys 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 + :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 "2024-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._rotate_service_account_signing_keys_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + 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 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 "2024-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._stop_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a 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 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 "2024-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._start_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_payload, (IOBase, bytes)): + _content = request_payload + else: + _json = self._serialize.body(request_payload, "RunCommandRequest") + + _request = build_run_command_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: _models.RunCommandRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: 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 RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Is either a RunCommandRequest type or a + IO[bytes] type. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_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.v2024_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 "2024-02-02-preview") + ) + 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) + 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._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RunCommandResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RunCommandResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RunCommandResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_command_result( + self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the 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 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.v2024_02_02_preview.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + _request = build_get_command_result_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpoint"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :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 OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_outbound_network_dependencies_endpoints_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", 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_guardrails_versions( + self, location: str, version: str, **kwargs: Any + ) -> _models.GuardrailsAvailableVersion: + """Gets supported Guardrails version in the specified subscription and location. + + Contains Guardrails version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: GuardrailsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.GuardrailsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_guardrails_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GuardrailsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_guardrails_versions( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.GuardrailsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either GuardrailsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_guardrails_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GuardrailsAvailableVersionsList", 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_safeguards_versions( + self, location: str, version: str, **kwargs: Any + ) -> _models.SafeguardsAvailableVersion: + """Gets supported Safeguards version in the specified subscription and location. + + Contains Safeguards version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: SafeguardsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.SafeguardsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_safeguards_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SafeguardsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_safeguards_versions( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.SafeguardsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either SafeguardsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_safeguards_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SafeguardsAvailableVersionsList", 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 + def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIterable["_models.MeshRevisionProfile"]: + """Lists mesh revision profiles for all meshes in the specified location. + + Contains extra metadata on each revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_revision_profiles_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MeshRevisionProfileList", 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_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: + """Gets a mesh revision profile for a specified mesh in the specified location. + + Contains extra metadata on the revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshRevisionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshRevisionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_revision_profile_request( + location=location, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshRevisionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_upgrade_profiles( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterable["_models.MeshUpgradeProfile"]: + """Lists available upgrades for all service meshes in a specific cluster. + + Lists available upgrades for all service meshes in a specific 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 MeshUpgradeProfile or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_upgrade_profiles_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MeshUpgradeProfileList", 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_mesh_upgrade_profile( + self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any + ) -> _models.MeshUpgradeProfile: + """Gets available upgrades for a service mesh in a cluster. + + Gets available upgrades for a service mesh in a 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 mode: The mode of the mesh. Required. + :type mode: str + :return: MeshUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshUpgradeProfile", pipeline_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/v2024_02_02_preview/aio/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_operation_status_result_operations.py new file mode 100644 index 000000000000..45e3a8875234 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_operation_status_result_operations.py @@ -0,0 +1,288 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operation_status_result_operations import ( + build_get_by_agent_pool_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OperationStatusResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`operation_status_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of operations in the specified managedCluster. + + Gets a list of operations in the specified managedCluster. + + :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 OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusResultList", 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, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified managed cluster. + + Get the status of a specific operation 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 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.v2024_02_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_by_agent_pool( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified agent pool. + + Get the status of a specific operation in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_02_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_by_agent_pool_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_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/v2024_02_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..208dc66e7796 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_operations.py @@ -0,0 +1,139 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: + """Gets a list of operations. + + Gets a list of operations. + + :return: An iterator like instance of either OperationValue or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_02_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..547dd7fae994 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,456 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnectionListResult: + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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 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.v2024_02_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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.v2024_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.v2024_02_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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: 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: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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. Is either a + PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = 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, "PrivateEndpointConnection") + + _request = build_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_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 "2024-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..b63d1d6d2939 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,120 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`private_link_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateLinkResourcesListResult: + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_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/v2024_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..60053e85c1f2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,198 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ResolvePrivateLinkServiceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`resolve_private_link_service_id` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.PrivateLinkResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. 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: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.PrivateLinkResource, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 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.v2024_02_02_preview.models.PrivateLinkResource + or IO[bytes] + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkResource] = 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, "PrivateLinkResource") + + _request = build_post_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResource", pipeline_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/v2024_02_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..fc4b8fcab3e4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_snapshots_operations.py @@ -0,0 +1,635 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._snapshots_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: + """Gets a list of snapshots in the specified subscription. + + 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.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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 + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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, **kwargs: Any) -> _models.Snapshot: + """Gets a snapshot. + + Gets a snapshot. + + :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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.Snapshot, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot or IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Snapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 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.v2024_02_02_preview.models.TagsObject or + IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py new file mode 100644 index 000000000000..507968771c87 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -0,0 +1,554 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._trusted_access_role_bindings_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class TrustedAccessRoleBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`trusted_access_role_bindings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """List trusted access role bindings. + + List trusted access role bindings. + + :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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBindingListResult", 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, trusted_access_role_binding_name: str, **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + """Get a trusted access role binding. + + Get a trusted access role binding. + + :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 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.v2024_02_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(trusted_access_role_binding, (IOBase, bytes)): + _content = trusted_access_role_binding + else: + _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + 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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: _models.TrustedAccessRoleBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :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.v2024_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.v2024_02_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :param trusted_access_role_binding: A trusted access role binding. Required. + :type trusted_access_role_binding: 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 TrustedAccessRoleBinding or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :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.v2024_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.v2024_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 "2024-02-02-preview") + ) + 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) + 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, + trusted_access_role_binding_name=trusted_access_role_binding_name, + trusted_access_role_binding=trusted_access_role_binding, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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.TrustedAccessRoleBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TrustedAccessRoleBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a trusted access role binding. + + Delete a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_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 "2024-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_trusted_access_roles_operations.py new file mode 100644 index 000000000000..d4ed3bf1ac7d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -0,0 +1,143 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._trusted_access_roles_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class TrustedAccessRolesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.aio.ContainerServiceClient`'s + :attr:`trusted_access_roles` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """List supported trusted access roles. + + List supported trusted access roles. + + :param location: The name of the Azure region. Required. + :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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleListResult", 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/__init__.py new file mode 100644 index 000000000000..615caab87d89 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/__init__.py @@ -0,0 +1,505 @@ +# 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 ._models_py3 import AbsoluteMonthlySchedule +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolArtifactStreamingProfile +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolDeleteMachinesParameter +from ._models_py3 import AgentPoolGPUProfile +from ._models_py3 import AgentPoolGatewayProfile +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolNetworkProfile +from ._models_py3 import AgentPoolSecurityProfile +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import AgentPoolWindowsProfile +from ._models_py3 import AzureKeyVaultKms +from ._models_py3 import CloudErrorBody +from ._models_py3 import ClusterUpgradeSettings +from ._models_py3 import CompatibleVersions +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceNetworkProfileKubeProxyConfig +from ._models_py3 import ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import CreationData +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import DailySchedule +from ._models_py3 import DateSpan +from ._models_py3 import DelegatedResource +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import ExtendedLocation +from ._models_py3 import GuardrailsAvailableVersion +from ._models_py3 import GuardrailsAvailableVersionsList +from ._models_py3 import GuardrailsAvailableVersionsProperties +from ._models_py3 import IPTag +from ._models_py3 import IstioCertificateAuthority +from ._models_py3 import IstioComponents +from ._models_py3 import IstioEgressGateway +from ._models_py3 import IstioIngressGateway +from ._models_py3 import IstioPluginCertificateAuthority +from ._models_py3 import IstioServiceMesh +from ._models_py3 import KubeletConfig +from ._models_py3 import KubernetesPatchVersion +from ._models_py3 import KubernetesVersion +from ._models_py3 import KubernetesVersionCapabilities +from ._models_py3 import KubernetesVersionListResult +from ._models_py3 import LinuxOSConfig +from ._models_py3 import Machine +from ._models_py3 import MachineIpAddress +from ._models_py3 import MachineListResult +from ._models_py3 import MachineNetworkProperties +from ._models_py3 import MachineProperties +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import MaintenanceWindow +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAIToolchainOperatorProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterAzureMonitorProfile +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoring +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics +from ._models_py3 import ManagedClusterAzureMonitorProfileContainerInsights +from ._models_py3 import ManagedClusterAzureMonitorProfileKubeStateMetrics +from ._models_py3 import ManagedClusterAzureMonitorProfileMetrics +from ._models_py3 import ManagedClusterBootstrapProfile +from ._models_py3 import ManagedClusterCostAnalysis +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterIngressProfile +from ._models_py3 import ManagedClusterIngressProfileWebAppRouting +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterManagedOutboundIPProfile +from ._models_py3 import ManagedClusterMetricsProfile +from ._models_py3 import ManagedClusterNATGatewayProfile +from ._models_py3 import ManagedClusterNodeProvisioningProfile +from ._models_py3 import ManagedClusterNodeResourceGroupProfile +from ._models_py3 import ManagedClusterOIDCIssuerProfile +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesForSnapshot +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterSecurityProfile +from ._models_py3 import ManagedClusterSecurityProfileDefender +from ._models_py3 import ManagedClusterSecurityProfileDefenderSecurityMonitoring +from ._models_py3 import ManagedClusterSecurityProfileImageCleaner +from ._models_py3 import ManagedClusterSecurityProfileImageIntegrity +from ._models_py3 import ManagedClusterSecurityProfileNodeRestriction +from ._models_py3 import ManagedClusterSecurityProfileWorkloadIdentity +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterSnapshot +from ._models_py3 import ManagedClusterSnapshotListResult +from ._models_py3 import ManagedClusterStaticEgressGatewayProfile +from ._models_py3 import ManagedClusterStorageProfile +from ._models_py3 import ManagedClusterStorageProfileBlobCSIDriver +from ._models_py3 import ManagedClusterStorageProfileDiskCSIDriver +from ._models_py3 import ManagedClusterStorageProfileFileCSIDriver +from ._models_py3 import ManagedClusterStorageProfileSnapshotController +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfile +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfileKeda +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler +from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue +from ._models_py3 import ManualScaleProfile +from ._models_py3 import MeshRevision +from ._models_py3 import MeshRevisionProfile +from ._models_py3 import MeshRevisionProfileList +from ._models_py3 import MeshRevisionProfileProperties +from ._models_py3 import MeshUpgradeProfile +from ._models_py3 import MeshUpgradeProfileList +from ._models_py3 import MeshUpgradeProfileProperties +from ._models_py3 import NetworkMonitoring +from ._models_py3 import NetworkProfileForSnapshot +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationStatusResult +from ._models_py3 import OperationStatusResultList +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PortRange +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import ProxyResource +from ._models_py3 import RelativeMonthlySchedule +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import SafeguardsAvailableVersion +from ._models_py3 import SafeguardsAvailableVersionsList +from ._models_py3 import SafeguardsAvailableVersionsProperties +from ._models_py3 import SafeguardsProfile +from ._models_py3 import ScaleProfile +from ._models_py3 import Schedule +from ._models_py3 import ServiceMeshProfile +from ._models_py3 import Snapshot +from ._models_py3 import SnapshotListResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import TrackedResource +from ._models_py3 import TrustedAccessRole +from ._models_py3 import TrustedAccessRoleBinding +from ._models_py3 import TrustedAccessRoleBindingListResult +from ._models_py3 import TrustedAccessRoleListResult +from ._models_py3 import TrustedAccessRoleRule +from ._models_py3 import UpgradeOverrideSettings +from ._models_py3 import UserAssignedIdentity +from ._models_py3 import VirtualMachineNodes +from ._models_py3 import VirtualMachinesProfile +from ._models_py3 import WeeklySchedule +from ._models_py3 import WindowsGmsaProfile + +from ._container_service_client_enums import AddonAutoscaling +from ._container_service_client_enums import AgentPoolMode +from ._container_service_client_enums import AgentPoolSSHAccess +from ._container_service_client_enums import AgentPoolType +from ._container_service_client_enums import ArtifactSource +from ._container_service_client_enums import BackendPoolType +from ._container_service_client_enums import ClusterServiceLoadBalancerHealthProbeMode +from ._container_service_client_enums import Code +from ._container_service_client_enums import ConnectionStatus +from ._container_service_client_enums import CreatedByType +from ._container_service_client_enums import Expander +from ._container_service_client_enums import ExtendedLocationTypes +from ._container_service_client_enums import Format +from ._container_service_client_enums import GPUInstanceProfile +from ._container_service_client_enums import GuardrailsSupport +from ._container_service_client_enums import IpFamily +from ._container_service_client_enums import IpvsScheduler +from ._container_service_client_enums import IstioIngressGatewayMode +from ._container_service_client_enums import KeyVaultNetworkAccessTypes +from ._container_service_client_enums import KubeletDiskType +from ._container_service_client_enums import KubernetesSupportPlan +from ._container_service_client_enums import Level +from ._container_service_client_enums import LicenseType +from ._container_service_client_enums import LoadBalancerSku +from ._container_service_client_enums import ManagedClusterPodIdentityProvisioningState +from ._container_service_client_enums import ManagedClusterSKUName +from ._container_service_client_enums import ManagedClusterSKUTier +from ._container_service_client_enums import Mode +from ._container_service_client_enums import NetworkDataplane +from ._container_service_client_enums import NetworkMode +from ._container_service_client_enums import NetworkPlugin +from ._container_service_client_enums import NetworkPluginMode +from ._container_service_client_enums import NetworkPolicy +from ._container_service_client_enums import NodeOSUpgradeChannel +from ._container_service_client_enums import NodeProvisioningMode +from ._container_service_client_enums import OSDiskType +from ._container_service_client_enums import OSSKU +from ._container_service_client_enums import OSType +from ._container_service_client_enums import OutboundType +from ._container_service_client_enums import PodIPAllocationMode +from ._container_service_client_enums import PrivateEndpointConnectionProvisioningState +from ._container_service_client_enums import Protocol +from ._container_service_client_enums import PublicNetworkAccess +from ._container_service_client_enums import ResourceIdentityType +from ._container_service_client_enums import RestrictionLevel +from ._container_service_client_enums import SafeguardsSupport +from ._container_service_client_enums import ScaleDownMode +from ._container_service_client_enums import ScaleSetEvictionPolicy +from ._container_service_client_enums import ScaleSetPriority +from ._container_service_client_enums import ServiceMeshMode +from ._container_service_client_enums import SnapshotType +from ._container_service_client_enums import TrustedAccessRoleBindingProvisioningState +from ._container_service_client_enums import Type +from ._container_service_client_enums import UpgradeChannel +from ._container_service_client_enums import WeekDay +from ._container_service_client_enums import WorkloadRuntime +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AbsoluteMonthlySchedule", + "AgentPool", + "AgentPoolArtifactStreamingProfile", + "AgentPoolAvailableVersions", + "AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem", + "AgentPoolDeleteMachinesParameter", + "AgentPoolGPUProfile", + "AgentPoolGatewayProfile", + "AgentPoolListResult", + "AgentPoolNetworkProfile", + "AgentPoolSecurityProfile", + "AgentPoolUpgradeProfile", + "AgentPoolUpgradeProfilePropertiesUpgradesItem", + "AgentPoolUpgradeSettings", + "AgentPoolWindowsProfile", + "AzureKeyVaultKms", + "CloudErrorBody", + "ClusterUpgradeSettings", + "CompatibleVersions", + "ContainerServiceLinuxProfile", + "ContainerServiceNetworkProfile", + "ContainerServiceNetworkProfileKubeProxyConfig", + "ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig", + "ContainerServiceSshConfiguration", + "ContainerServiceSshPublicKey", + "CreationData", + "CredentialResult", + "CredentialResults", + "DailySchedule", + "DateSpan", + "DelegatedResource", + "EndpointDependency", + "EndpointDetail", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "ExtendedLocation", + "GuardrailsAvailableVersion", + "GuardrailsAvailableVersionsList", + "GuardrailsAvailableVersionsProperties", + "IPTag", + "IstioCertificateAuthority", + "IstioComponents", + "IstioEgressGateway", + "IstioIngressGateway", + "IstioPluginCertificateAuthority", + "IstioServiceMesh", + "KubeletConfig", + "KubernetesPatchVersion", + "KubernetesVersion", + "KubernetesVersionCapabilities", + "KubernetesVersionListResult", + "LinuxOSConfig", + "Machine", + "MachineIpAddress", + "MachineListResult", + "MachineNetworkProperties", + "MachineProperties", + "MaintenanceConfiguration", + "MaintenanceConfigurationListResult", + "MaintenanceWindow", + "ManagedCluster", + "ManagedClusterAADProfile", + "ManagedClusterAIToolchainOperatorProfile", + "ManagedClusterAPIServerAccessProfile", + "ManagedClusterAccessProfile", + "ManagedClusterAddonProfile", + "ManagedClusterAddonProfileIdentity", + "ManagedClusterAgentPoolProfile", + "ManagedClusterAgentPoolProfileProperties", + "ManagedClusterAutoUpgradeProfile", + "ManagedClusterAzureMonitorProfile", + "ManagedClusterAzureMonitorProfileAppMonitoring", + "ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation", + "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs", + "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics", + "ManagedClusterAzureMonitorProfileContainerInsights", + "ManagedClusterAzureMonitorProfileKubeStateMetrics", + "ManagedClusterAzureMonitorProfileMetrics", + "ManagedClusterBootstrapProfile", + "ManagedClusterCostAnalysis", + "ManagedClusterHTTPProxyConfig", + "ManagedClusterIdentity", + "ManagedClusterIngressProfile", + "ManagedClusterIngressProfileWebAppRouting", + "ManagedClusterListResult", + "ManagedClusterLoadBalancerProfile", + "ManagedClusterLoadBalancerProfileManagedOutboundIPs", + "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + "ManagedClusterLoadBalancerProfileOutboundIPs", + "ManagedClusterManagedOutboundIPProfile", + "ManagedClusterMetricsProfile", + "ManagedClusterNATGatewayProfile", + "ManagedClusterNodeProvisioningProfile", + "ManagedClusterNodeResourceGroupProfile", + "ManagedClusterOIDCIssuerProfile", + "ManagedClusterPodIdentity", + "ManagedClusterPodIdentityException", + "ManagedClusterPodIdentityProfile", + "ManagedClusterPodIdentityProvisioningError", + "ManagedClusterPodIdentityProvisioningErrorBody", + "ManagedClusterPodIdentityProvisioningInfo", + "ManagedClusterPoolUpgradeProfile", + "ManagedClusterPoolUpgradeProfileUpgradesItem", + "ManagedClusterPropertiesAutoScalerProfile", + "ManagedClusterPropertiesForSnapshot", + "ManagedClusterSKU", + "ManagedClusterSecurityProfile", + "ManagedClusterSecurityProfileDefender", + "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + "ManagedClusterSecurityProfileImageCleaner", + "ManagedClusterSecurityProfileImageIntegrity", + "ManagedClusterSecurityProfileNodeRestriction", + "ManagedClusterSecurityProfileWorkloadIdentity", + "ManagedClusterServicePrincipalProfile", + "ManagedClusterSnapshot", + "ManagedClusterSnapshotListResult", + "ManagedClusterStaticEgressGatewayProfile", + "ManagedClusterStorageProfile", + "ManagedClusterStorageProfileBlobCSIDriver", + "ManagedClusterStorageProfileDiskCSIDriver", + "ManagedClusterStorageProfileFileCSIDriver", + "ManagedClusterStorageProfileSnapshotController", + "ManagedClusterUpgradeProfile", + "ManagedClusterWindowsProfile", + "ManagedClusterWorkloadAutoScalerProfile", + "ManagedClusterWorkloadAutoScalerProfileKeda", + "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + "ManagedServiceIdentityUserAssignedIdentitiesValue", + "ManualScaleProfile", + "MeshRevision", + "MeshRevisionProfile", + "MeshRevisionProfileList", + "MeshRevisionProfileProperties", + "MeshUpgradeProfile", + "MeshUpgradeProfileList", + "MeshUpgradeProfileProperties", + "NetworkMonitoring", + "NetworkProfileForSnapshot", + "OSOptionProfile", + "OSOptionProperty", + "OperationListResult", + "OperationStatusResult", + "OperationStatusResultList", + "OperationValue", + "OutboundEnvironmentEndpoint", + "OutboundEnvironmentEndpointCollection", + "PortRange", + "PowerState", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourcesListResult", + "PrivateLinkServiceConnectionState", + "ProxyResource", + "RelativeMonthlySchedule", + "Resource", + "ResourceReference", + "RunCommandRequest", + "RunCommandResult", + "SafeguardsAvailableVersion", + "SafeguardsAvailableVersionsList", + "SafeguardsAvailableVersionsProperties", + "SafeguardsProfile", + "ScaleProfile", + "Schedule", + "ServiceMeshProfile", + "Snapshot", + "SnapshotListResult", + "SubResource", + "SysctlConfig", + "SystemData", + "TagsObject", + "TimeInWeek", + "TimeSpan", + "TrackedResource", + "TrustedAccessRole", + "TrustedAccessRoleBinding", + "TrustedAccessRoleBindingListResult", + "TrustedAccessRoleListResult", + "TrustedAccessRoleRule", + "UpgradeOverrideSettings", + "UserAssignedIdentity", + "VirtualMachineNodes", + "VirtualMachinesProfile", + "WeeklySchedule", + "WindowsGmsaProfile", + "AddonAutoscaling", + "AgentPoolMode", + "AgentPoolSSHAccess", + "AgentPoolType", + "ArtifactSource", + "BackendPoolType", + "ClusterServiceLoadBalancerHealthProbeMode", + "Code", + "ConnectionStatus", + "CreatedByType", + "Expander", + "ExtendedLocationTypes", + "Format", + "GPUInstanceProfile", + "GuardrailsSupport", + "IpFamily", + "IpvsScheduler", + "IstioIngressGatewayMode", + "KeyVaultNetworkAccessTypes", + "KubeletDiskType", + "KubernetesSupportPlan", + "Level", + "LicenseType", + "LoadBalancerSku", + "ManagedClusterPodIdentityProvisioningState", + "ManagedClusterSKUName", + "ManagedClusterSKUTier", + "Mode", + "NetworkDataplane", + "NetworkMode", + "NetworkPlugin", + "NetworkPluginMode", + "NetworkPolicy", + "NodeOSUpgradeChannel", + "NodeProvisioningMode", + "OSDiskType", + "OSSKU", + "OSType", + "OutboundType", + "PodIPAllocationMode", + "PrivateEndpointConnectionProvisioningState", + "Protocol", + "PublicNetworkAccess", + "ResourceIdentityType", + "RestrictionLevel", + "SafeguardsSupport", + "ScaleDownMode", + "ScaleSetEvictionPolicy", + "ScaleSetPriority", + "ServiceMeshMode", + "SnapshotType", + "TrustedAccessRoleBindingProvisioningState", + "Type", + "UpgradeChannel", + "WeekDay", + "WorkloadRuntime", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_container_service_client_enums.py new file mode 100644 index 000000000000..2f32f9d78404 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_container_service_client_enums.py @@ -0,0 +1,708 @@ +# 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 enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AddonAutoscaling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.""" + + ENABLED = "Enabled" + """Feature to autoscale AKS-managed add-ons is enabled. The default VPA update mode is Initial + mode.""" + DISABLED = "Disabled" + """Feature to autoscale AKS-managed add-ons is disabled.""" + + +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: + https://docs.microsoft.com/azure/aks/use-system-pools. + """ + + SYSTEM = "System" + """System agent pools are primarily for hosting critical system pods such as CoreDNS and + metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at + least 2vCPUs and 4GB of memory.""" + USER = "User" + """User agent pools are primarily for hosting your application pods.""" + GATEWAY = "Gateway" + """Gateway agent pools are dedicated to providing static egress IPs to pods. For more details, see + https://aka.ms/aks/static-egress-gateway.""" + + +class AgentPoolSSHAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SSH access method of an agent pool.""" + + LOCAL_USER = "LocalUser" + """Can SSH onto the node as a local user using private key.""" + DISABLED = "Disabled" + """SSH service will be turned off on the node.""" + + +class AgentPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of Agent Pool.""" + + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + """Create an Agent Pool backed by a Virtual Machine Scale Set.""" + AVAILABILITY_SET = "AvailabilitySet" + """Use of this is strongly discouraged.""" + VIRTUAL_MACHINES = "VirtualMachines" + """Create an Agent Pool backed by a Single Instance VM orchestration mode.""" + + +class ArtifactSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The source where the artifacts are downloaded from.""" + + CACHE = "Cache" + """pull images from Azure Container Registry with cache""" + DIRECT = "Direct" + """pull images from Microsoft Artifact Registry""" + + +class BackendPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the managed inbound Load Balancer BackendPool.""" + + NODE_IP_CONFIGURATION = "NodeIPConfiguration" + """The type of the managed inbound Load Balancer BackendPool. + https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend.""" + NODE_IP = "NodeIP" + """The type of the managed inbound Load Balancer BackendPool. + https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend.""" + + +class ClusterServiceLoadBalancerHealthProbeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The health probing behavior for External Traffic Policy Cluster services.""" + + SERVICE_NODE_PORT = "ServiceNodePort" + """Each External Traffic Policy Cluster service will have its own health probe targeting service + nodePort.""" + SHARED = "Shared" + """All External Traffic Policy Cluster services in a Standard Load Balancer will have a dedicated + health probe targeting the backend nodes' kube-proxy health check port 10256.""" + + +class Code(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tells whether the cluster is Running or Stopped.""" + + RUNNING = "Running" + """The cluster is running.""" + STOPPED = "Stopped" + """The cluster is stopped.""" + + +class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The private link service connection status.""" + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class Expander(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """If not specified, the default is 'random'. See `expanders + `_ + for more information. + """ + + LEAST_WASTE = "least-waste" + """Selects the node group that will have the least idle CPU (if tied, unused memory) after + scale-up. This is useful when you have different classes of nodes, for example, high CPU or + high memory nodes, and only want to expand those when there are pending pods that need a lot of + those resources.""" + MOST_PODS = "most-pods" + """Selects the node group that would be able to schedule the most pods when scaling up. This is + useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note + that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple + smaller nodes at once.""" + PRIORITY = "priority" + """Selects the node group that has the highest priority assigned by the user. It's configuration + is described in more details `here + `_.""" + RANDOM = "random" + """Used when you don't have a particular need for the node groups to scale differently.""" + + +class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of extendedLocation.""" + + EDGE_ZONE = "EdgeZone" + + +class Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Format.""" + + AZURE = "azure" + """Return azure auth-provider kubeconfig. This format is deprecated in v1.22 and will be fully + removed in v1.26. See: https://aka.ms/k8s/changes-1-26.""" + EXEC_ENUM = "exec" + """Return exec format kubeconfig. This format requires kubelogin binary in the path.""" + + +class GPUInstanceProfile(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.""" + + MIG1_G = "MIG1g" + MIG2_G = "MIG2g" + MIG3_G = "MIG3g" + MIG4_G = "MIG4g" + MIG7_G = "MIG7g" + + +class GuardrailsSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the version is preview or stable.""" + + PREVIEW = "Preview" + """The version is preview. It is not recommended to use preview versions on critical production + clusters. The preview version may not support all use-cases.""" + STABLE = "Stable" + """The version is stable and can be used on critical production clusters.""" + + +class IpFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """To determine if address belongs IPv4 or IPv6 family.""" + + I_PV4 = "IPv4" + """IPv4 family""" + I_PV6 = "IPv6" + """IPv6 family""" + + +class IpvsScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. + """ + + ROUND_ROBIN = "RoundRobin" + """Round Robin""" + LEAST_CONNECTION = "LeastConnection" + """Least Connection""" + + +class IstioIngressGatewayMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mode of an ingress gateway.""" + + EXTERNAL = "External" + """The ingress gateway is assigned a public IP address and is publicly accessible.""" + INTERNAL = "Internal" + """The ingress gateway is assigned an internal IP address and cannot is accessed publicly.""" + + +class KeyVaultNetworkAccessTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network access of key vault. The possible values are ``Public`` and ``Private``. ``Public`` + means the key vault allows public access from all networks. ``Private`` means the key vault + disables public access and enables private link. The default value is ``Public``. + """ + + PUBLIC = "Public" + PRIVATE = "Private" + + +class KubeletDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet + ephemeral storage. + """ + + OS = "OS" + """Kubelet will use the OS disk for its data.""" + TEMPORARY = "Temporary" + """Kubelet will use the temporary disk for its data.""" + + +class KubernetesSupportPlan(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Different support tiers for AKS managed clusters.""" + + KUBERNETES_OFFICIAL = "KubernetesOfficial" + """Support for the version is the same as for the open source Kubernetes offering. Official + Kubernetes open source community support versions for 1 year after release.""" + AKS_LONG_TERM_SUPPORT = "AKSLongTermSupport" + """Support for the version extended past the KubernetesOfficial support of 1 year. AKS continues + to patch CVEs for another 1 year, for a total of 2 years of support.""" + + +class Level(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except + those that AKS excludes via systemExcludedNamespaces. + """ + + OFF = "Off" + WARNING = "Warning" + ENFORCEMENT = "Enforcement" + + +class LicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. + """ + + NONE = "None" + """No additional licensing is applied.""" + WINDOWS_SERVER = "Windows_Server" + """Enables Azure Hybrid User Benefits for Windows VMs.""" + + +class LoadBalancerSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. + """ + + STANDARD = "standard" + """Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information + about on working with the load balancer in the managed cluster, see the `standard Load Balancer + `_ article.""" + BASIC = "basic" + """Use a basic Load Balancer with limited functionality.""" + + +class ManagedClusterPodIdentityProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of the pod identity.""" + + ASSIGNED = "Assigned" + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + +class ManagedClusterSKUName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The name of a managed cluster SKU.""" + + BASE = "Base" + """Base option for the AKS control plane.""" + + +class ManagedClusterSKUTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """If not specified, the default is 'Free'. See `AKS Pricing Tier + `_ for more details. + """ + + PREMIUM = "Premium" + """Cluster has premium capabilities in addition to all of the capabilities included in 'Standard'. + Premium enables selection of LongTermSupport (aka.ms/aks/lts) for certain Kubernetes versions.""" + STANDARD = "Standard" + """Recommended for mission-critical and production workloads. Includes Kubernetes control plane + autoscaling, workload-intensive testing, and up to 5,000 nodes per cluster. Guarantees 99.95% + availability of the Kubernetes API server endpoint for clusters that use Availability Zones and + 99.9% of availability for clusters that don't use Availability Zones.""" + FREE = "Free" + """The cluster management is free, but charged for VM, storage, and networking usage. Best for + experimenting, learning, simple testing, or workloads with fewer than 10 nodes. Not recommended + for production use cases.""" + + +class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify which proxy mode to use ('IPTABLES' or 'IPVS').""" + + IPTABLES = "IPTABLES" + """IPTables proxy mode""" + IPVS = "IPVS" + """IPVS proxy mode. Must be using Kubernetes version >= 1.22.""" + + +class NetworkDataplane(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network dataplane used in the Kubernetes cluster.""" + + AZURE = "azure" + """Use Azure network dataplane.""" + CILIUM = "cilium" + """Use Cilium network dataplane. See `Azure CNI Powered by Cilium + `_ for more information.""" + + +class NetworkMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This cannot be specified if networkPlugin is anything other than 'azure'.""" + + TRANSPARENT = "transparent" + """No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure + CNI. See `Transparent Mode `_ for + more information.""" + BRIDGE = "bridge" + """This is no longer supported""" + + +class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network plugin used for building the Kubernetes network.""" + + AZURE = "azure" + """Use the Azure CNI network plugin. See `Azure CNI (advanced) networking + `_ for + more information.""" + KUBENET = "kubenet" + """Use the Kubenet network plugin. See `Kubenet (basic) networking + `_ for more + information.""" + NONE = "none" + """Do not use a network plugin. A custom CNI will need to be installed after cluster creation for + networking functionality.""" + + +class NetworkPluginMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The mode the network plugin should use.""" + + OVERLAY = "overlay" + """Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than + Kubenet reference plugins host-local and bridge.""" + + +class NetworkPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network policy used for building the Kubernetes network.""" + + NONE = "none" + """Network policies will not be enforced. This is the default value when NetworkPolicy is not + specified.""" + CALICO = "calico" + """Use Calico network policies. See `differences between Azure and Calico policies + `_ + for more information.""" + AZURE = "azure" + """Use Azure network policies. See `differences between Azure and Calico policies + `_ + for more information.""" + CILIUM = "cilium" + """Use Cilium to enforce network policies. This requires networkDataplane to be 'cilium'.""" + + +class NodeOSUpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA.""" + + NONE = "None" + """No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means + you are responsible for your security updates""" + UNMANAGED = "Unmanaged" + """OS updates will be applied automatically through the OS built-in patching infrastructure. Newly + scaled in machines will be unpatched initially, and will be patched at some later time by the + OS's infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner + apply security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows + does not apply security patches automatically and so for them this option is equivalent to None + till further notice""" + SECURITY_PATCH = "SecurityPatch" + """AKS will update the nodes VHD with patches from the image maintainer labelled "security only" + on a regular basis. Where possible, patches will also be applied without reimaging to existing + nodes. Some patches, such as kernel patches, cannot be applied to existing nodes without + disruption. For such patches, the VHD will be updated, and machines will be rolling reimaged to + that VHD following maintenance windows and surge settings. This option incurs the extra cost of + hosting the VHDs in your node resource group.""" + NODE_IMAGE = "NodeImage" + """AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a + weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following + maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option + as AKS hosts the images.""" + + +class NodeProvisioningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Once the mode it set to Auto, it cannot be changed back to Manual.""" + + MANUAL = "Manual" + """Nodes are provisioned manually by the user""" + AUTO = "Auto" + """Nodes are provisioned automatically by AKS using Karpenter. Fixed size Node Pools can still be + created, but autoscaling Node Pools cannot be. (See aka.ms/aks/nap for more details).""" + + +class OSDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """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 + `_. + """ + + MANAGED = "Managed" + """Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data + loss should the VM need to be relocated to another host. Since containers aren't designed to + have local state persisted, this behavior offers limited value while providing some drawbacks, + including slower node provisioning and higher read/write latency.""" + EPHEMERAL = "Ephemeral" + """Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This + provides lower read/write latency, along with faster node scaling and cluster upgrades.""" + + +class OSSKU(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """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. + """ + + UBUNTU = "Ubuntu" + """Use Ubuntu as the OS for node images.""" + MARINER = "Mariner" + """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" + AZURE_LINUX = "AzureLinux" + """Use AzureLinux as the OS for node images. Azure Linux is a container-optimized Linux distro + built by Microsoft, visit https://aka.ms/azurelinux for more information.""" + CBL_MARINER = "CBLMariner" + """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" + WINDOWS2019 = "Windows2019" + """Use Windows2019 as the OS for node images. Unsupported for system node pools. Windows2019 only + supports Windows2019 containers; it cannot run Windows2022 containers and vice versa.""" + 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.""" + WINDOWS_ANNUAL = "WindowsAnnual" + """Use Windows Annual Channel version as the OS for node images. Unsupported for system node + pools. Details about supported container images and kubernetes versions under different AKS + Annual Channel versions could be seen in https://aka.ms/aks/windows-annual-channel-details.""" + + +class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operating system type. The default is Linux.""" + + LINUX = "Linux" + """Use Linux.""" + WINDOWS = "Windows" + """Use Windows.""" + + +class OutboundType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This can only be set at cluster creation time and cannot be changed later. For more information + see `egress outbound type `_. + """ + + LOAD_BALANCER = "loadBalancer" + """The load balancer is used for egress through an AKS assigned public IP. This supports + Kubernetes services of type 'loadBalancer'. For more information see `outbound type + loadbalancer + `_.""" + USER_DEFINED_ROUTING = "userDefinedRouting" + """Egress paths must be defined by the user. This is an advanced scenario and requires proper + network configuration. For more information see `outbound type userDefinedRouting + `_.""" + MANAGED_NAT_GATEWAY = "managedNATGateway" + """The AKS-managed NAT gateway is used for egress.""" + USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" + """The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an + advanced scenario and requires proper network configuration.""" + + +class PodIPAllocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default + is 'DynamicIndividual'. + """ + + DYNAMIC_INDIVIDUAL = "DynamicIndividual" + """Each pod gets a single IP address assigned. This is better for maximizing a small to medium + subnet of size /16 or smaller. The Azure CNI cluster with dynamic IP allocation defaults to + this mode if the customer does not explicitly specify a podIPAllocationMode""" + STATIC_BLOCK = "StaticBlock" + """Each node is statically allocated CIDR block(s) of size /28 = 16 IPs per block to satisfy the + maxPods per node. Number of CIDR blocks >= (maxPods / 16). The block, rather than a single IP, + counts against the Azure Vnet Private IP limit of 65K. Therefore block mode is suitable for + running larger workloads with more than the current limit of 65K pods in a cluster. This mode + is better suited to scale with larger subnets of /15 or bigger""" + + +class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + CANCELED = "Canceled" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + +class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The network protocol of the port.""" + + TCP = "TCP" + """TCP protocol.""" + UDP = "UDP" + """UDP protocol.""" + + +class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allow or deny public network access for AKS.""" + + ENABLED = "Enabled" + """Inbound/Outbound to the managedCluster is allowed.""" + DISABLED = "Disabled" + """Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed.""" + SECURED_BY_PERIMETER = "SecuredByPerimeter" + """Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters.""" + + +class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """For more information see `use managed identities in AKS + `_. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + """Use an implicitly created system assigned managed identity to manage cluster resources. Master + components in the control plane such as kube-controller-manager will use the system assigned + managed identity to manipulate Azure resources.""" + USER_ASSIGNED = "UserAssigned" + """Use a user-specified identity to manage cluster resources. Master components in the control + plane such as kube-controller-manager will use the specified user assigned managed identity to + manipulate Azure resources.""" + NONE = "None" + """Do not use a managed identity for the Managed Cluster, service principal will be used instead.""" + + +class RestrictionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The restriction level applied to the cluster's node resource group.""" + + UNRESTRICTED = "Unrestricted" + """All RBAC permissions are allowed on the managed node resource group""" + READ_ONLY = "ReadOnly" + """Only */read RBAC permissions allowed on the managed node resource group""" + + +class SafeguardsSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the version is preview or stable.""" + + PREVIEW = "Preview" + """The version is preview. It is not recommended to use preview versions on critical production + clusters. The preview version may not support all use-cases.""" + STABLE = "Stable" + """The version is stable and can be used on critical production clusters.""" + + +class ScaleDownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes how VMs are added to or removed from Agent Pools. See `billing states + `_. + """ + + DELETE = "Delete" + """Create new instances during scale up and remove instances during scale down.""" + DEALLOCATE = "Deallocate" + """Attempt to start deallocated instances (if they exist) during scale up and deallocate instances + during scale down.""" + + +class ScaleSetEvictionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. + For more information about eviction see `spot VMs + `_. + """ + + DELETE = "Delete" + """Nodes in the underlying Scale Set of the node pool are deleted when they're evicted.""" + DEALLOCATE = "Deallocate" + """Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state + upon eviction. Nodes in the stopped-deallocated state count against your compute quota and can + cause issues with cluster scaling or upgrading.""" + + +class ScaleSetPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Virtual Machine Scale Set priority.""" + + SPOT = "Spot" + """Spot priority VMs will be used. There is no SLA for spot nodes. See `spot on AKS + `_ for more information.""" + REGULAR = "Regular" + """Regular VMs will be used.""" + + +class ServiceMeshMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mode of the service mesh.""" + + ISTIO = "Istio" + """Istio deployed as an AKS addon.""" + DISABLED = "Disabled" + """Mesh is disabled.""" + + +class SnapshotType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a snapshot. The default is NodePool.""" + + NODE_POOL = "NodePool" + """The snapshot is a snapshot of a node pool.""" + MANAGED_CLUSTER = "ManagedCluster" + """The snapshot is a snapshot of a managed cluster.""" + + +class TrustedAccessRoleBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of trusted access role binding.""" + + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + +class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.""" + + FIRST = "First" + """First.""" + SECOND = "Second" + """Second.""" + THIRD = "Third" + """Third.""" + FOURTH = "Fourth" + """Fourth.""" + LAST = "Last" + """Last.""" + + +class UpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """For more information see `setting the AKS cluster auto-upgrade channel + `_. + """ + + RAPID = "rapid" + """Automatically upgrade the cluster to the latest supported patch release on the latest supported + minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor + version where N is the latest supported minor version, the cluster first upgrades to the latest + supported patch version on N-1 minor version. For example, if a cluster is running version + 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is + upgraded to 1.18.6, then is upgraded to 1.19.1.""" + STABLE = "stable" + """Automatically upgrade the cluster to the latest supported patch release on minor version N-1, + where N is the latest supported minor version. For example, if a cluster is running version + 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded + to 1.18.6.""" + PATCH = "patch" + """Automatically upgrade the cluster to the latest supported patch version when it becomes + available while keeping the minor version the same. For example, if a cluster is running + version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is + upgraded to 1.17.9.""" + NODE_IMAGE = "node-image" + """Automatically upgrade the node image to the latest version available. Consider using + nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from + Kubernetes version patching""" + NONE = "none" + """Disables auto-upgrades and keeps the cluster at its current version of Kubernetes.""" + + +class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The weekday enum.""" + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + + +class WorkloadRuntime(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Determines the type of workload a node can run.""" + + OCI_CONTAINER = "OCIContainer" + """Nodes will use Kubelet to run standard OCI container workloads.""" + WASM_WASI = "WasmWasi" + """Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview).""" + KATA_MSHV_VM_ISOLATION = "KataMshvVmIsolation" + """Nodes can use (Kata + Cloud Hypervisor + Hyper-V) to enable Nested VM-based pods (Preview). Due + to the use Hyper-V, AKS node OS itself is a nested VM (the root OS) of Hyper-V. Thus it can + only be used with VM series that support Nested Virtualization such as Dv3 series.""" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_models_py3.py new file mode 100644 index 000000000000..6d2d309de764 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_models_py3.py @@ -0,0 +1,10325 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union + +from ... import _serialization + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AbsoluteMonthlySchedule(_serialization.Model): + """For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + + All required parameters must be populated in order to send to server. + + :ivar interval_months: Specifies the number of months between each set of occurrences. + Required. + :vartype interval_months: int + :ivar day_of_month: The date of the month. Required. + :vartype day_of_month: int + """ + + _validation = { + "interval_months": {"required": True, "maximum": 6, "minimum": 1}, + "day_of_month": {"required": True, "maximum": 31, "minimum": 1}, + } + + _attribute_map = { + "interval_months": {"key": "intervalMonths", "type": "int"}, + "day_of_month": {"key": "dayOfMonth", "type": "int"}, + } + + def __init__(self, *, interval_months: int, day_of_month: int, **kwargs: Any) -> None: + """ + :keyword interval_months: Specifies the number of months between each set of occurrences. + Required. + :paramtype interval_months: int + :keyword day_of_month: The date of the month. Required. + :paramtype day_of_month: int + """ + super().__init__(**kwargs) + self.interval_months = interval_months + self.day_of_month = day_of_month + + +class SubResource(_serialization.Model): + """Reference to another subresource. + + 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 + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgentPool(SubResource): # pylint: disable=too-many-instance-attributes + """Agent Pool. + + 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_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.v2024_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.v2024_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_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.v2024_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.v2024_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_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.v2024_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.v2024_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_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.v2024_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_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.v2024_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_02_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_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.v2024_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 + 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.v2024_02_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.AgentPoolGatewayProfile + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "count": {"key": "properties.count", "type": "int"}, + "vm_size": {"key": "properties.vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "properties.osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "properties.osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "properties.kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "properties.workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "properties.messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "properties.vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "properties.podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "properties.podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "properties.maxPods", "type": "int"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "os_sku": {"key": "properties.osSKU", "type": "str"}, + "max_count": {"key": "properties.maxCount", "type": "int"}, + "min_count": {"key": "properties.minCount", "type": "int"}, + "enable_auto_scaling": {"key": "properties.enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "properties.scaleDownMode", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "mode": {"key": "properties.mode", "type": "str"}, + "orchestrator_version": {"key": "properties.orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "properties.currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "properties.nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "properties.upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "power_state": {"key": "properties.powerState", "type": "PowerState"}, + "availability_zones": {"key": "properties.availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "properties.enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "properties.enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "properties.nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "properties.scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "properties.scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "properties.spotMaxPrice", "type": "float"}, + "tags": {"key": "properties.tags", "type": "{str}"}, + "node_labels": {"key": "properties.nodeLabels", "type": "{str}"}, + "node_taints": {"key": "properties.nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "properties.nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "properties.proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "properties.kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "properties.linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "properties.enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "properties.enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "properties.enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "properties.gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "properties.capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "properties.hostGroupID", "type": "str"}, + "windows_profile": {"key": "properties.windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "properties.networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "properties.securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "properties.gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": { + "key": "properties.artifactStreamingProfile", + "type": "AgentPoolArtifactStreamingProfile", + }, + "virtual_machines_profile": {"key": "properties.virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": { + "key": "properties.virtualMachineNodesStatus", + "type": "[VirtualMachineNodes]", + }, + "gateway_profile": {"key": "properties.gatewayProfile", "type": "AgentPoolGatewayProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type_properties_type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_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.v2024_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.v2024_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_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.v2024_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.v2024_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_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.v2024_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.v2024_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_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.v2024_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_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.v2024_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_02_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_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.v2024_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 + 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.v2024_02_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.AgentPoolGatewayProfile + """ + super().__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.message_of_the_day = message_of_the_day + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.pod_ip_allocation_mode = pod_ip_allocation_mode + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + 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.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = power_state + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.enable_custom_ca_trust = enable_custom_ca_trust + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.node_initialization_taints = node_initialization_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + self.capacity_reservation_group_id = capacity_reservation_group_id + self.host_group_id = host_group_id + self.windows_profile = windows_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.gpu_profile = gpu_profile + self.artifact_streaming_profile = artifact_streaming_profile + self.virtual_machines_profile = virtual_machines_profile + self.virtual_machine_nodes_status = virtual_machine_nodes_status + self.gateway_profile = gateway_profile + + +class AgentPoolArtifactStreamingProfile(_serialization.Model): + """AgentPoolArtifactStreamingProfile. + + :ivar enabled: Artifact streaming speeds up the cold-start of containers on a node through + on-demand image loading. To use this feature, container images must also enable artifact + streaming on ACR. If not specified, the default is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Artifact streaming speeds up the cold-start of containers on a node through + on-demand image loading. To use this feature, container images must also enable artifact + streaming on ACR. If not specified, the default is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class AgentPoolAvailableVersions(_serialization.Model): + """The list of available versions for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the agent pool version list. + :vartype id: str + :ivar name: The name of the agent pool version list. + :vartype name: str + :ivar type: Type of the agent pool version list. + :vartype type: str + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] # pylint: disable=line-too-long + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "agent_pool_versions": { + "key": "properties.agentPoolVersions", + "type": "[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]", + }, + } + + def __init__( + self, + *, + agent_pool_versions: Optional[List["_models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.agent_pool_versions = agent_pool_versions + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(_serialization.Model): # pylint: disable=name-too-long + """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "default": {"key": "default", "type": "bool"}, + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.default = default + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolDeleteMachinesParameter(_serialization.Model): + """Specifies a list of machine names from the agent pool to be deleted. + + All required parameters must be populated in order to send to server. + + :ivar machine_names: The agent pool machine names. Required. + :vartype machine_names: list[str] + """ + + _validation = { + "machine_names": {"required": True}, + } + + _attribute_map = { + "machine_names": {"key": "machineNames", "type": "[str]"}, + } + + def __init__(self, *, machine_names: List[str], **kwargs: Any) -> None: + """ + :keyword machine_names: The agent pool machine names. Required. + :paramtype machine_names: list[str] + """ + super().__init__(**kwargs) + self.machine_names = machine_names + + +class AgentPoolGatewayProfile(_serialization.Model): + """Profile of the managed cluster gateway agent pool. + + :ivar public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each + static egress gateway to provide public egress. The size of Public IPPrefix should be selected + by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The + IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public + IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 + nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + :vartype public_ip_prefix_size: int + """ + + _validation = { + "public_ip_prefix_size": {"maximum": 31, "minimum": 28}, + } + + _attribute_map = { + "public_ip_prefix_size": {"key": "publicIPPrefixSize", "type": "int"}, + } + + def __init__(self, *, public_ip_prefix_size: int = 31, **kwargs: Any) -> None: + """ + :keyword public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each + static egress gateway to provide public egress. The size of Public IPPrefix should be selected + by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The + IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public + IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 + nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + :paramtype public_ip_prefix_size: int + """ + super().__init__(**kwargs) + self.public_ip_prefix_size = public_ip_prefix_size + + +class AgentPoolGPUProfile(_serialization.Model): + """AgentPoolGPUProfile. + + :ivar install_gpu_driver: The default value is true when the vmSize of the agent pool contains + a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated + GPU resource. Setting this field to false prevents automatic GPU driver installation. In that + case, in order for the GPU to be usable, the user must perform GPU driver installation + themselves. + :vartype install_gpu_driver: bool + """ + + _attribute_map = { + "install_gpu_driver": {"key": "installGPUDriver", "type": "bool"}, + } + + def __init__(self, *, install_gpu_driver: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword install_gpu_driver: The default value is true when the vmSize of the agent pool + contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an + associated GPU resource. Setting this field to false prevents automatic GPU driver + installation. In that case, in order for the GPU to be usable, the user must perform GPU driver + installation themselves. + :paramtype install_gpu_driver: bool + """ + super().__init__(**kwargs) + self.install_gpu_driver = install_gpu_driver + + +class AgentPoolListResult(_serialization.Model): + """The response from the List Agent Pools operation. + + 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.v2024_02_02_preview.models.AgentPool] + :ivar next_link: The URL to get the next set of agent pool results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AgentPool]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_02_02_preview.models.AgentPool] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = 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.v2024_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.v2024_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] + """ + + _attribute_map = { + "node_public_ip_tags": {"key": "nodePublicIPTags", "type": "[IPTag]"}, + "allowed_host_ports": {"key": "allowedHostPorts", "type": "[PortRange]"}, + "application_security_groups": {"key": "applicationSecurityGroups", "type": "[str]"}, + } + + def __init__( + self, + *, + node_public_ip_tags: Optional[List["_models.IPTag"]] = None, + allowed_host_ports: Optional[List["_models.PortRange"]] = None, + application_security_groups: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword node_public_ip_tags: IPTags of instance-level public IPs. + :paramtype node_public_ip_tags: + list[~azure.mgmt.containerservice.v2024_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.v2024_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] + """ + super().__init__(**kwargs) + self.node_public_ip_tags = node_public_ip_tags + self.allowed_host_ports = allowed_host_ports + self.application_security_groups = application_security_groups + + +class AgentPoolSecurityProfile(_serialization.Model): + """The security settings of an agent pool. + + :ivar ssh_access: SSH access method of an agent pool. Known values are: "LocalUser" and + "Disabled". + :vartype ssh_access: str or + ~azure.mgmt.containerservice.v2024_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. + :vartype enable_vtpm: bool + :ivar enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only + signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. + If not specified, the default is false. + :vartype enable_secure_boot: bool + """ + + _attribute_map = { + "ssh_access": {"key": "sshAccess", "type": "str"}, + "enable_vtpm": {"key": "enableVTPM", "type": "bool"}, + "enable_secure_boot": {"key": "enableSecureBoot", "type": "bool"}, + } + + def __init__( + self, + *, + ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = None, + enable_vtpm: Optional[bool] = None, + enable_secure_boot: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword ssh_access: SSH access method of an agent pool. Known values are: "LocalUser" and + "Disabled". + :paramtype ssh_access: str or + ~azure.mgmt.containerservice.v2024_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. + :paramtype enable_vtpm: bool + :keyword enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only + signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. + If not specified, the default is false. + :paramtype enable_secure_boot: bool + """ + super().__init__(**kwargs) + self.ssh_access = ssh_access + self.enable_vtpm = enable_vtpm + self.enable_secure_boot = enable_secure_boot + + +class AgentPoolUpgradeProfile(_serialization.Model): + """The list of available upgrades for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the agent pool upgrade profile. + :vartype id: str + :ivar name: The name of the agent pool upgrade profile. + :vartype name: str + :ivar type: The type of the agent pool upgrade profile. + :vartype type: str + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :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.v2024_02_02_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "kubernetes_version": {"required": True}, + "os_type": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "upgrades": {"key": "properties.upgrades", "type": "[AgentPoolUpgradeProfilePropertiesUpgradesItem]"}, + "latest_node_image_version": {"key": "properties.latestNodeImageVersion", "type": "str"}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "_models.OSType"] = "Linux", + upgrades: Optional[List["_models.AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + latest_node_image_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :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.v2024_02_02_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2024_02_02_preview.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.kubernetes_version = kubernetes_version + self.os_type = os_type + self.upgrades = upgrades + self.latest_node_image_version = latest_node_image_version + + +class AgentPoolUpgradeProfilePropertiesUpgradesItem(_serialization.Model): # pylint: disable=name-too-long + """AgentPoolUpgradeProfilePropertiesUpgradesItem. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, *, kubernetes_version: Optional[str] = None, is_preview: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolUpgradeSettings(_serialization.Model): + """Settings for upgrading an agentpool. + + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '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 + 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :vartype max_surge: 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 + minutes. + :vartype drain_timeout_in_minutes: int + :ivar node_soak_duration_in_minutes: The amount of time (in minutes) to wait after draining a + 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 + """ + + _validation = { + "drain_timeout_in_minutes": {"maximum": 1440, "minimum": 1}, + "node_soak_duration_in_minutes": {"maximum": 30, "minimum": 0}, + } + + _attribute_map = { + "max_surge": {"key": "maxSurge", "type": "str"}, + "drain_timeout_in_minutes": {"key": "drainTimeoutInMinutes", "type": "int"}, + "node_soak_duration_in_minutes": {"key": "nodeSoakDurationInMinutes", "type": "int"}, + } + + def __init__( + self, + *, + max_surge: Optional[str] = None, + drain_timeout_in_minutes: Optional[int] = None, + node_soak_duration_in_minutes: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '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 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: 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 + minutes. + :paramtype drain_timeout_in_minutes: int + :keyword node_soak_duration_in_minutes: The amount of time (in minutes) to wait after draining + 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 + """ + super().__init__(**kwargs) + self.max_surge = max_surge + self.drain_timeout_in_minutes = drain_timeout_in_minutes + self.node_soak_duration_in_minutes = node_soak_duration_in_minutes + + +class AgentPoolWindowsProfile(_serialization.Model): + """The Windows agent pool's specific profile. + + :ivar disable_outbound_nat: The default value is false. Outbound NAT can only be disabled if + the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP + enabled. + :vartype disable_outbound_nat: bool + """ + + _attribute_map = { + "disable_outbound_nat": {"key": "disableOutboundNat", "type": "bool"}, + } + + def __init__(self, *, disable_outbound_nat: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword disable_outbound_nat: The default value is false. Outbound NAT can only be disabled if + the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP + enabled. + :paramtype disable_outbound_nat: bool + """ + super().__init__(**kwargs) + self.disable_outbound_nat = disable_outbound_nat + + +class AzureKeyVaultKms(_serialization.Model): + """Azure Key Vault key management service settings for the security profile. + + :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. + :vartype key_id: str + :ivar key_vault_network_access: Network access of key vault. The possible values are ``Public`` + and ``Private``. ``Public`` means the key vault allows public access from all networks. + ``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.v2024_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. + :vartype key_vault_resource_id: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "key_id": {"key": "keyId", "type": "str"}, + "key_vault_network_access": {"key": "keyVaultNetworkAccess", "type": "str"}, + "key_vault_resource_id": {"key": "keyVaultResourceId", "type": "str"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + key_id: Optional[str] = None, + key_vault_network_access: Union[str, "_models.KeyVaultNetworkAccessTypes"] = "Public", + key_vault_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable Azure Key Vault key management service. The default is + 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. + :paramtype key_id: str + :keyword key_vault_network_access: Network access of key vault. The possible values are + ``Public`` and ``Private``. ``Public`` means the key vault allows public access from all + 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.v2024_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. + :paramtype key_vault_resource_id: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.key_id = key_id + self.key_vault_network_access = key_vault_network_access + self.key_vault_resource_id = key_vault_resource_id + + +class CloudErrorBody(_serialization.Model): + """An error response from the Container service. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2024_02_02_preview.models.CloudErrorBody] + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[CloudErrorBody]"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.CloudErrorBody"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.CloudErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ClusterUpgradeSettings(_serialization.Model): + """Settings for upgrading a cluster. + + :ivar override_settings: Settings for overrides. + :vartype override_settings: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.UpgradeOverrideSettings + """ + + _attribute_map = { + "override_settings": {"key": "overrideSettings", "type": "UpgradeOverrideSettings"}, + } + + def __init__(self, *, override_settings: Optional["_models.UpgradeOverrideSettings"] = None, **kwargs: Any) -> None: + """ + :keyword override_settings: Settings for overrides. + :paramtype override_settings: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.UpgradeOverrideSettings + """ + super().__init__(**kwargs) + self.override_settings = override_settings + + +class CompatibleVersions(_serialization.Model): + """Version information about a product/service that is compatible with a service mesh revision. + + :ivar name: The product/service name. + :vartype name: str + :ivar versions: Product/service versions compatible with a service mesh add-on revision. + :vartype versions: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "versions": {"key": "versions", "type": "[str]"}, + } + + def __init__(self, *, name: Optional[str] = None, versions: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword name: The product/service name. + :paramtype name: str + :keyword versions: Product/service versions compatible with a service mesh add-on revision. + :paramtype versions: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.versions = versions + + +class ContainerServiceLinuxProfile(_serialization.Model): + """Profile for Linux VMs in the container service cluster. + + All required parameters must be populated in order to send to server. + + :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.v2024_02_02_preview.models.ContainerServiceSshConfiguration + """ + + _validation = { + "admin_username": {"required": True, "pattern": r"^[A-Za-z][-A-Za-z0-9_]*$"}, + "ssh": {"required": True}, + } + + _attribute_map = { + "admin_username": {"key": "adminUsername", "type": "str"}, + "ssh": {"key": "ssh", "type": "ContainerServiceSshConfiguration"}, + } + + def __init__(self, *, admin_username: str, ssh: "_models.ContainerServiceSshConfiguration", **kwargs: Any) -> None: + """ + :keyword admin_username: The administrator username to use for Linux VMs. Required. + :paramtype admin_username: str + :keyword ssh: The SSH configuration for Linux-based VMs running on Azure. Required. + :paramtype ssh: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ContainerServiceSshConfiguration + """ + super().__init__(**kwargs) + self.admin_username = admin_username + self.ssh = ssh + + +class ContainerServiceNetworkProfile(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Profile of network configuration. + + :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.v2024_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.v2024_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.v2024_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.v2024_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.v2024_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 + not overlap with any Subnet IP ranges. + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :vartype dns_service_ip: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type + `_. Known values are: "loadBalancer", + "userDefinedRouting", "managedNATGateway", and "userAssignedNATGateway". + :vartype outbound_type: str or + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterLoadBalancerProfile + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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] + :ivar service_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. They must not overlap with + any Subnet IP ranges. + :vartype service_cidrs: list[str] + :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.v2024_02_02_preview.models.IpFamily] + :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.v2024_02_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + :ivar monitoring: This addon can be used to configure network monitoring and generate network + monitoring data in Prometheus format. + :vartype monitoring: ~azure.mgmt.containerservice.v2024_02_02_preview.models.NetworkMonitoring + """ + + _validation = { + "pod_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "service_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + } + + _attribute_map = { + "network_plugin": {"key": "networkPlugin", "type": "str"}, + "network_plugin_mode": {"key": "networkPluginMode", "type": "str"}, + "network_policy": {"key": "networkPolicy", "type": "str"}, + "network_mode": {"key": "networkMode", "type": "str"}, + "network_dataplane": {"key": "networkDataplane", "type": "str"}, + "pod_cidr": {"key": "podCidr", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "outbound_type": {"key": "outboundType", "type": "str"}, + "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, + "load_balancer_profile": {"key": "loadBalancerProfile", "type": "ManagedClusterLoadBalancerProfile"}, + "nat_gateway_profile": {"key": "natGatewayProfile", "type": "ManagedClusterNATGatewayProfile"}, + "static_egress_gateway_profile": { + "key": "staticEgressGatewayProfile", + "type": "ManagedClusterStaticEgressGatewayProfile", + }, + "pod_cidrs": {"key": "podCidrs", "type": "[str]"}, + "service_cidrs": {"key": "serviceCidrs", "type": "[str]"}, + "ip_families": {"key": "ipFamilies", "type": "[str]"}, + "kube_proxy_config": {"key": "kubeProxyConfig", "type": "ContainerServiceNetworkProfileKubeProxyConfig"}, + "monitoring": {"key": "monitoring", "type": "NetworkMonitoring"}, + } + + def __init__( + self, + *, + network_plugin: Union[str, "_models.NetworkPlugin"] = "kubenet", + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, + network_dataplane: Optional[Union[str, "_models.NetworkDataplane"]] = None, + pod_cidr: str = "10.244.0.0/16", + service_cidr: str = "10.0.0.0/16", + dns_service_ip: str = "10.0.0.10", + outbound_type: Union[str, "_models.OutboundType"] = "loadBalancer", + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, + load_balancer_profile: Optional["_models.ManagedClusterLoadBalancerProfile"] = None, + nat_gateway_profile: Optional["_models.ManagedClusterNATGatewayProfile"] = None, + static_egress_gateway_profile: Optional["_models.ManagedClusterStaticEgressGatewayProfile"] = None, + pod_cidrs: Optional[List[str]] = None, + service_cidrs: Optional[List[str]] = None, + ip_families: Optional[List[Union[str, "_models.IpFamily"]]] = None, + kube_proxy_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfig"] = None, + monitoring: Optional["_models.NetworkMonitoring"] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_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.v2024_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.v2024_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.v2024_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.v2024_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 + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Known values are: "loadBalancer", + "userDefinedRouting", "managedNATGateway", and "userAssignedNATGateway". + :paramtype outbound_type: str or + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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] + :keyword service_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. They must not overlap + with any Subnet IP ranges. + :paramtype service_cidrs: list[str] + :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.v2024_02_02_preview.models.IpFamily] + :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.v2024_02_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + :keyword monitoring: This addon can be used to configure network monitoring and generate + network monitoring data in Prometheus format. + :paramtype monitoring: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.NetworkMonitoring + """ + super().__init__(**kwargs) + self.network_plugin = network_plugin + self.network_plugin_mode = network_plugin_mode + self.network_policy = network_policy + self.network_mode = network_mode + self.network_dataplane = network_dataplane + self.pod_cidr = pod_cidr + self.service_cidr = service_cidr + self.dns_service_ip = dns_service_ip + self.outbound_type = outbound_type + self.load_balancer_sku = load_balancer_sku + self.load_balancer_profile = load_balancer_profile + self.nat_gateway_profile = nat_gateway_profile + self.static_egress_gateway_profile = static_egress_gateway_profile + self.pod_cidrs = pod_cidrs + self.service_cidrs = service_cidrs + self.ip_families = ip_families + self.kube_proxy_config = kube_proxy_config + self.monitoring = monitoring + + +class ContainerServiceNetworkProfileKubeProxyConfig(_serialization.Model): # pylint: disable=name-too-long + """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'. + + :ivar enabled: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, + kube-proxy is enabled in AKS by default without these customizations). + :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.v2024_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.v2024_02_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "mode": {"key": "mode", "type": "str"}, + "ipvs_config": {"key": "ipvsConfig", "type": "ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + mode: Optional[Union[str, "_models.Mode"]] = None, + ipvs_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' + exists, kube-proxy is enabled in AKS by default without these customizations). + :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.v2024_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.v2024_02_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + """ + super().__init__(**kwargs) + self.enabled = enabled + self.mode = mode + self.ipvs_config = ipvs_config + + +class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(_serialization.Model): # pylint: disable=name-too-long + """Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + + :ivar scheduler: IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and + "LeastConnection". + :vartype scheduler: str or + ~azure.mgmt.containerservice.v2024_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 + :ivar tcp_fin_timeout_seconds: The timeout value used for IPVS TCP sessions after receiving a + FIN in seconds. Must be a positive integer value. + :vartype tcp_fin_timeout_seconds: int + :ivar udp_timeout_seconds: The timeout value used for IPVS UDP packets in seconds. Must be a + positive integer value. + :vartype udp_timeout_seconds: int + """ + + _attribute_map = { + "scheduler": {"key": "scheduler", "type": "str"}, + "tcp_timeout_seconds": {"key": "tcpTimeoutSeconds", "type": "int"}, + "tcp_fin_timeout_seconds": {"key": "tcpFinTimeoutSeconds", "type": "int"}, + "udp_timeout_seconds": {"key": "udpTimeoutSeconds", "type": "int"}, + } + + def __init__( + self, + *, + scheduler: Optional[Union[str, "_models.IpvsScheduler"]] = None, + tcp_timeout_seconds: Optional[int] = None, + tcp_fin_timeout_seconds: Optional[int] = None, + udp_timeout_seconds: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword scheduler: IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and + "LeastConnection". + :paramtype scheduler: str or + ~azure.mgmt.containerservice.v2024_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 + :keyword tcp_fin_timeout_seconds: The timeout value used for IPVS TCP sessions after receiving + a FIN in seconds. Must be a positive integer value. + :paramtype tcp_fin_timeout_seconds: int + :keyword udp_timeout_seconds: The timeout value used for IPVS UDP packets in seconds. Must be a + positive integer value. + :paramtype udp_timeout_seconds: int + """ + super().__init__(**kwargs) + self.scheduler = scheduler + self.tcp_timeout_seconds = tcp_timeout_seconds + self.tcp_fin_timeout_seconds = tcp_fin_timeout_seconds + self.udp_timeout_seconds = udp_timeout_seconds + + +class ContainerServiceSshConfiguration(_serialization.Model): + """SSH configuration for Linux-based VMs running on Azure. + + All required parameters must be populated in order to send to server. + + :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.v2024_02_02_preview.models.ContainerServiceSshPublicKey] + """ + + _validation = { + "public_keys": {"required": True}, + } + + _attribute_map = { + "public_keys": {"key": "publicKeys", "type": "[ContainerServiceSshPublicKey]"}, + } + + def __init__(self, *, public_keys: List["_models.ContainerServiceSshPublicKey"], **kwargs: Any) -> None: + """ + :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.v2024_02_02_preview.models.ContainerServiceSshPublicKey] + """ + super().__init__(**kwargs) + self.public_keys = public_keys + + +class ContainerServiceSshPublicKey(_serialization.Model): + """Contains information about SSH certificate public key data. + + All required parameters must be populated in order to send to server. + + :ivar key_data: Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. Required. + :vartype key_data: str + """ + + _validation = { + "key_data": {"required": True}, + } + + _attribute_map = { + "key_data": {"key": "keyData", "type": "str"}, + } + + def __init__(self, *, key_data: str, **kwargs: Any) -> None: + """ + :keyword key_data: Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. Required. + :paramtype key_data: str + """ + super().__init__(**kwargs) + self.key_data = key_data + + +class CreationData(_serialization.Model): + """Data used when creating a target resource from a source resource. + + :ivar source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :vartype source_resource_id: str + """ + + _attribute_map = { + "source_resource_id": {"key": "sourceResourceId", "type": "str"}, + } + + def __init__(self, *, source_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :paramtype source_resource_id: str + """ + super().__init__(**kwargs) + self.source_resource_id = source_resource_id + + +class CredentialResult(_serialization.Model): + """The credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytes + """ + + _validation = { + "name": {"readonly": True}, + "value": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "bytearray"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.value = None + + +class CredentialResults(_serialization.Model): + """The list credential result response. + + 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.v2024_02_02_preview.models.CredentialResult] + """ + + _validation = { + "kubeconfigs": {"readonly": True}, + } + + _attribute_map = { + "kubeconfigs": {"key": "kubeconfigs", "type": "[CredentialResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.kubeconfigs = None + + +class DailySchedule(_serialization.Model): + """For schedules like: 'recur every day' or 'recur every 3 days'. + + All required parameters must be populated in order to send to server. + + :ivar interval_days: Specifies the number of days between each set of occurrences. Required. + :vartype interval_days: int + """ + + _validation = { + "interval_days": {"required": True, "maximum": 7, "minimum": 1}, + } + + _attribute_map = { + "interval_days": {"key": "intervalDays", "type": "int"}, + } + + def __init__(self, *, interval_days: int, **kwargs: Any) -> None: + """ + :keyword interval_days: Specifies the number of days between each set of occurrences. Required. + :paramtype interval_days: int + """ + super().__init__(**kwargs) + self.interval_days = interval_days + + +class DateSpan(_serialization.Model): + """For example, between '2022-12-23' and '2023-01-05'. + + All required parameters must be populated in order to send to server. + + :ivar start: The start date of the date span. Required. + :vartype start: ~datetime.date + :ivar end: The end date of the date span. Required. + :vartype end: ~datetime.date + """ + + _validation = { + "start": {"required": True}, + "end": {"required": True}, + } + + _attribute_map = { + "start": {"key": "start", "type": "date"}, + "end": {"key": "end", "type": "date"}, + } + + def __init__(self, *, start: datetime.date, end: datetime.date, **kwargs: Any) -> None: + """ + :keyword start: The start date of the date span. Required. + :paramtype start: ~datetime.date + :keyword end: The end date of the date span. Required. + :paramtype end: ~datetime.date + """ + super().__init__(**kwargs) + self.start = start + self.end = end + + +class DelegatedResource(_serialization.Model): + """Delegated resource properties - internal use only. + + :ivar resource_id: The ARM resource id of the delegated resource - internal use only. + :vartype resource_id: str + :ivar tenant_id: The tenant id of the delegated resource - internal use only. + :vartype tenant_id: str + :ivar referral_resource: The delegation id of the referral delegation (optional) - internal use + only. + :vartype referral_resource: str + :ivar location: The source resource location - internal use only. + :vartype location: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "referral_resource": {"key": "referralResource", "type": "str"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + tenant_id: Optional[str] = None, + referral_resource: Optional[str] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The ARM resource id of the delegated resource - internal use only. + :paramtype resource_id: str + :keyword tenant_id: The tenant id of the delegated resource - internal use only. + :paramtype tenant_id: str + :keyword referral_resource: The delegation id of the referral delegation (optional) - internal + use only. + :paramtype referral_resource: str + :keyword location: The source resource location - internal use only. + :paramtype location: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.tenant_id = tenant_id + self.referral_resource = referral_resource + self.location = location + + +class EndpointDependency(_serialization.Model): + """A domain name that AKS agent nodes are reaching at. + + :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.v2024_02_02_preview.models.EndpointDetail] + """ + + _attribute_map = { + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": {"key": "endpointDetails", "type": "[EndpointDetail]"}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["_models.EndpointDetail"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.EndpointDetail] + """ + super().__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(_serialization.Model): + """connect information from the AKS agent nodes to a single endpoint. + + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str + """ + + _attribute_map = { + "ip_address": {"key": "ipAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "protocol": {"key": "protocol", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ + super().__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.protocol = protocol + self.description = description + + +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON + """ + + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + 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 + + +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class ExtendedLocation(_serialization.Model): + """The complex type of the extended location. + + :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.v2024_02_02_preview.models.ExtendedLocationTypes + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_02_02_preview.models.ExtendedLocationTypes + """ + super().__init__(**kwargs) + self.name = name + self.type = type + + +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_02_02_preview.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class GuardrailsAvailableVersion(Resource): + """Available Guardrails Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_02_02_preview.models.SystemData + :ivar properties: Whether the version is default or not and support info. Required. + :vartype properties: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.GuardrailsAvailableVersionsProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "GuardrailsAvailableVersionsProperties"}, + } + + def __init__(self, *, properties: "_models.GuardrailsAvailableVersionsProperties", **kwargs: Any) -> None: + """ + :keyword properties: Whether the version is default or not and support info. Required. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.GuardrailsAvailableVersionsProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class GuardrailsAvailableVersionsList(_serialization.Model): + """Hold values properties, which is array of GuardrailsVersions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of AKS supported Guardrails versions. + :vartype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.GuardrailsAvailableVersion] + :ivar next_link: The URL to get the next Guardrails available version. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[GuardrailsAvailableVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.GuardrailsAvailableVersion"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Array of AKS supported Guardrails versions. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.GuardrailsAvailableVersion] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class GuardrailsAvailableVersionsProperties(_serialization.Model): + """Whether the version is default or not and support info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_default_version: + :vartype is_default_version: bool + :ivar support: Whether the version is preview or stable. Known values are: "Preview" and + "Stable". + :vartype support: str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.GuardrailsSupport + """ + + _validation = { + "is_default_version": {"readonly": True}, + "support": {"readonly": True}, + } + + _attribute_map = { + "is_default_version": {"key": "isDefaultVersion", "type": "bool"}, + "support": {"key": "support", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.is_default_version = None + self.support = None + + +class IPTag(_serialization.Model): + """Contains the IPTag associated with the object. + + :ivar ip_tag_type: The IP tag type. Example: RoutingPreference. + :vartype ip_tag_type: str + :ivar tag: The value of the IP tag associated with the public IP. Example: Internet. + :vartype tag: str + """ + + _attribute_map = { + "ip_tag_type": {"key": "ipTagType", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + } + + def __init__(self, *, ip_tag_type: Optional[str] = None, tag: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword ip_tag_type: The IP tag type. Example: RoutingPreference. + :paramtype ip_tag_type: str + :keyword tag: The value of the IP tag associated with the public IP. Example: Internet. + :paramtype tag: str + """ + super().__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag + + +class IstioCertificateAuthority(_serialization.Model): + """Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin + certificates as described here https://aka.ms/asm-plugin-ca. + + :ivar plugin: Plugin certificates information for Service Mesh. + :vartype plugin: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioPluginCertificateAuthority + """ + + _attribute_map = { + "plugin": {"key": "plugin", "type": "IstioPluginCertificateAuthority"}, + } + + def __init__(self, *, plugin: Optional["_models.IstioPluginCertificateAuthority"] = None, **kwargs: Any) -> None: + """ + :keyword plugin: Plugin certificates information for Service Mesh. + :paramtype plugin: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioPluginCertificateAuthority + """ + super().__init__(**kwargs) + self.plugin = plugin + + +class IstioComponents(_serialization.Model): + """Istio components configuration. + + :ivar ingress_gateways: Istio ingress gateways. + :vartype ingress_gateways: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioIngressGateway] + :ivar egress_gateways: Istio egress gateways. + :vartype egress_gateways: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioEgressGateway] + """ + + _attribute_map = { + "ingress_gateways": {"key": "ingressGateways", "type": "[IstioIngressGateway]"}, + "egress_gateways": {"key": "egressGateways", "type": "[IstioEgressGateway]"}, + } + + def __init__( + self, + *, + ingress_gateways: Optional[List["_models.IstioIngressGateway"]] = None, + egress_gateways: Optional[List["_models.IstioEgressGateway"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword ingress_gateways: Istio ingress gateways. + :paramtype ingress_gateways: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioIngressGateway] + :keyword egress_gateways: Istio egress gateways. + :paramtype egress_gateways: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioEgressGateway] + """ + super().__init__(**kwargs) + self.ingress_gateways = ingress_gateways + self.egress_gateways = egress_gateways + + +class IstioEgressGateway(_serialization.Model): + """Istio egress gateway configuration. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable the egress gateway. Required. + :vartype enabled: bool + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: bool, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable the egress gateway. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class IstioIngressGateway(_serialization.Model): + """Istio ingress gateway configuration. For now, we support up to one external ingress gateway + named ``aks-istio-ingressgateway-external`` and one internal ingress gateway named + ``aks-istio-ingressgateway-internal``. + + 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.v2024_02_02_preview.models.IstioIngressGatewayMode + :ivar enabled: Whether to enable the ingress gateway. Required. + :vartype enabled: bool + """ + + _validation = { + "mode": {"required": True}, + "enabled": {"required": True}, + } + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, mode: Union[str, "_models.IstioIngressGatewayMode"], enabled: bool, **kwargs: Any) -> None: + """ + :keyword mode: Mode of an ingress gateway. Required. Known values are: "External" and + "Internal". + :paramtype mode: str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioIngressGatewayMode + :keyword enabled: Whether to enable the ingress gateway. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.mode = mode + self.enabled = enabled + + +class IstioPluginCertificateAuthority(_serialization.Model): + """Plugin certificates information for Service Mesh. + + :ivar key_vault_id: The resource ID of the Key Vault. + :vartype key_vault_id: str + :ivar cert_object_name: Intermediate certificate object name in Azure Key Vault. + :vartype cert_object_name: str + :ivar key_object_name: Intermediate certificate private key object name in Azure Key Vault. + :vartype key_object_name: str + :ivar root_cert_object_name: Root certificate object name in Azure Key Vault. + :vartype root_cert_object_name: str + :ivar cert_chain_object_name: Certificate chain object name in Azure Key Vault. + :vartype cert_chain_object_name: str + """ + + _attribute_map = { + "key_vault_id": {"key": "keyVaultId", "type": "str"}, + "cert_object_name": {"key": "certObjectName", "type": "str"}, + "key_object_name": {"key": "keyObjectName", "type": "str"}, + "root_cert_object_name": {"key": "rootCertObjectName", "type": "str"}, + "cert_chain_object_name": {"key": "certChainObjectName", "type": "str"}, + } + + def __init__( + self, + *, + key_vault_id: Optional[str] = None, + cert_object_name: Optional[str] = None, + key_object_name: Optional[str] = None, + root_cert_object_name: Optional[str] = None, + cert_chain_object_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword key_vault_id: The resource ID of the Key Vault. + :paramtype key_vault_id: str + :keyword cert_object_name: Intermediate certificate object name in Azure Key Vault. + :paramtype cert_object_name: str + :keyword key_object_name: Intermediate certificate private key object name in Azure Key Vault. + :paramtype key_object_name: str + :keyword root_cert_object_name: Root certificate object name in Azure Key Vault. + :paramtype root_cert_object_name: str + :keyword cert_chain_object_name: Certificate chain object name in Azure Key Vault. + :paramtype cert_chain_object_name: str + """ + super().__init__(**kwargs) + self.key_vault_id = key_vault_id + self.cert_object_name = cert_object_name + self.key_object_name = key_object_name + self.root_cert_object_name = root_cert_object_name + self.cert_chain_object_name = cert_chain_object_name + + +class IstioServiceMesh(_serialization.Model): + """Istio service mesh configuration. + + :ivar components: Istio components configuration. + :vartype components: ~azure.mgmt.containerservice.v2024_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.v2024_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: + https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. + :vartype revisions: list[str] + """ + + _validation = { + "revisions": {"max_items": 2, "min_items": 0, "unique": True}, + } + + _attribute_map = { + "components": {"key": "components", "type": "IstioComponents"}, + "certificate_authority": {"key": "certificateAuthority", "type": "IstioCertificateAuthority"}, + "revisions": {"key": "revisions", "type": "[str]"}, + } + + def __init__( + self, + *, + components: Optional["_models.IstioComponents"] = None, + certificate_authority: Optional["_models.IstioCertificateAuthority"] = None, + revisions: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword components: Istio components configuration. + :paramtype components: ~azure.mgmt.containerservice.v2024_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.v2024_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: + https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. + :paramtype revisions: list[str] + """ + super().__init__(**kwargs) + self.components = components + self.certificate_authority = certificate_authority + self.revisions = revisions + + +class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes + """See `AKS custom node configuration + `_ for more details. + + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + 85%. + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + is 80%. + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\\ ). + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + is rotated. + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int + """ + + _validation = { + "container_log_max_files": {"minimum": 2}, + } + + _attribute_map = { + "cpu_manager_policy": {"key": "cpuManagerPolicy", "type": "str"}, + "cpu_cfs_quota": {"key": "cpuCfsQuota", "type": "bool"}, + "cpu_cfs_quota_period": {"key": "cpuCfsQuotaPeriod", "type": "str"}, + "image_gc_high_threshold": {"key": "imageGcHighThreshold", "type": "int"}, + "image_gc_low_threshold": {"key": "imageGcLowThreshold", "type": "int"}, + "topology_manager_policy": {"key": "topologyManagerPolicy", "type": "str"}, + "allowed_unsafe_sysctls": {"key": "allowedUnsafeSysctls", "type": "[str]"}, + "fail_swap_on": {"key": "failSwapOn", "type": "bool"}, + "container_log_max_size_mb": {"key": "containerLogMaxSizeMB", "type": "int"}, + "container_log_max_files": {"key": "containerLogMaxFiles", "type": "int"}, + "pod_max_pids": {"key": "podMaxPids", "type": "int"}, + } + + def __init__( + self, + *, + cpu_manager_policy: Optional[str] = None, + cpu_cfs_quota: Optional[bool] = None, + cpu_cfs_quota_period: Optional[str] = None, + image_gc_high_threshold: Optional[int] = None, + image_gc_low_threshold: Optional[int] = None, + topology_manager_policy: Optional[str] = None, + allowed_unsafe_sysctls: Optional[List[str]] = None, + fail_swap_on: Optional[bool] = None, + container_log_max_size_mb: Optional[int] = None, + container_log_max_files: Optional[int] = None, + pod_max_pids: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ + super().__init__(**kwargs) + self.cpu_manager_policy = cpu_manager_policy + self.cpu_cfs_quota = cpu_cfs_quota + self.cpu_cfs_quota_period = cpu_cfs_quota_period + self.image_gc_high_threshold = image_gc_high_threshold + self.image_gc_low_threshold = image_gc_low_threshold + self.topology_manager_policy = topology_manager_policy + self.allowed_unsafe_sysctls = allowed_unsafe_sysctls + self.fail_swap_on = fail_swap_on + self.container_log_max_size_mb = container_log_max_size_mb + self.container_log_max_files = container_log_max_files + self.pod_max_pids = pod_max_pids + + +class KubernetesPatchVersion(_serialization.Model): + """Kubernetes patch version profile. + + :ivar upgrades: Possible upgrade path for given patch version. + :vartype upgrades: list[str] + """ + + _attribute_map = { + "upgrades": {"key": "upgrades", "type": "[str]"}, + } + + def __init__(self, *, upgrades: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword upgrades: Possible upgrade path for given patch version. + :paramtype upgrades: list[str] + """ + super().__init__(**kwargs) + self.upgrades = upgrades + + +class KubernetesVersion(_serialization.Model): + """Kubernetes version profile for given major.minor release. + + :ivar version: major.minor version of Kubernetes release. + :vartype version: str + :ivar capabilities: Capabilities on this Kubernetes version. + :vartype capabilities: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.KubernetesPatchVersion] + """ + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "capabilities": {"key": "capabilities", "type": "KubernetesVersionCapabilities"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + "patch_versions": {"key": "patchVersions", "type": "{KubernetesPatchVersion}"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + capabilities: Optional["_models.KubernetesVersionCapabilities"] = None, + is_default: Optional[bool] = None, + is_preview: Optional[bool] = None, + patch_versions: Optional[Dict[str, "_models.KubernetesPatchVersion"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: major.minor version of Kubernetes release. + :paramtype version: str + :keyword capabilities: Capabilities on this Kubernetes version. + :paramtype capabilities: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.KubernetesPatchVersion] + """ + super().__init__(**kwargs) + self.version = version + self.capabilities = capabilities + self.is_default = is_default + self.is_preview = is_preview + self.patch_versions = patch_versions + + +class KubernetesVersionCapabilities(_serialization.Model): + """Capabilities on this Kubernetes version. + + :ivar support_plan: + :vartype support_plan: list[str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.KubernetesSupportPlan] + """ + + _attribute_map = { + "support_plan": {"key": "supportPlan", "type": "[str]"}, + } + + def __init__( + self, *, support_plan: Optional[List[Union[str, "_models.KubernetesSupportPlan"]]] = None, **kwargs: Any + ) -> None: + """ + :keyword support_plan: + :paramtype support_plan: list[str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.KubernetesSupportPlan] + """ + super().__init__(**kwargs) + self.support_plan = support_plan + + +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.v2024_02_02_preview.models.KubernetesVersion] + """ + + _attribute_map = { + "values": {"key": "values", "type": "[KubernetesVersion]"}, + } + + 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.v2024_02_02_preview.models.KubernetesVersion] + """ + super().__init__(**kwargs) + self.values = values + + +class LinuxOSConfig(_serialization.Model): + """See `AKS custom node configuration + `_ for more details. + + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2024_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 + `_. + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int + """ + + _attribute_map = { + "sysctls": {"key": "sysctls", "type": "SysctlConfig"}, + "transparent_huge_page_enabled": {"key": "transparentHugePageEnabled", "type": "str"}, + "transparent_huge_page_defrag": {"key": "transparentHugePageDefrag", "type": "str"}, + "swap_file_size_mb": {"key": "swapFileSizeMB", "type": "int"}, + } + + def __init__( + self, + *, + sysctls: Optional["_models.SysctlConfig"] = None, + transparent_huge_page_enabled: Optional[str] = None, + transparent_huge_page_defrag: Optional[str] = None, + swap_file_size_mb: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2024_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 + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ + super().__init__(**kwargs) + self.sysctls = sysctls + self.transparent_huge_page_enabled = transparent_huge_page_enabled + self.transparent_huge_page_defrag = transparent_huge_page_defrag + self.swap_file_size_mb = swap_file_size_mb + + +class Machine(SubResource): + """A machine. Contains details about the underlying virtual machine. A machine may be visible here + but not in kubectl get nodes; if so it may be because the machine has not been registered with + the Kubernetes API Server yet. + + 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 properties: The properties of the machine. + :vartype properties: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MachineProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "properties": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "MachineProperties"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.properties = None + + +class MachineIpAddress(_serialization.Model): + """The machine IP address details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip: IPv4 or IPv6 address of the machine. + :vartype ip: str + :ivar family: To determine if address belongs IPv4 or IPv6 family. Known values are: "IPv4" and + "IPv6". + :vartype family: str or ~azure.mgmt.containerservice.v2024_02_02_preview.models.IpFamily + """ + + _validation = { + "ip": {"readonly": True}, + "family": {"readonly": True}, + } + + _attribute_map = { + "ip": {"key": "ip", "type": "str"}, + "family": {"key": "family", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.ip = None + self.family = None + + +class MachineListResult(_serialization.Model): + """The response from the List Machines operation. + + 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.v2024_02_02_preview.models.Machine] + :ivar next_link: The URL to get the next set of machine results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Machine]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_02_02_preview.models.Machine] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MachineNetworkProperties(_serialization.Model): + """network properties of the machine. + + 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.v2024_02_02_preview.models.MachineIpAddress] + """ + + _validation = { + "ip_addresses": {"readonly": True}, + } + + _attribute_map = { + "ip_addresses": {"key": "ipAddresses", "type": "[MachineIpAddress]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.ip_addresses = None + + +class MachineProperties(_serialization.Model): + """The properties of the machine. + + 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.v2024_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 + """ + + _validation = { + "network": {"readonly": True}, + "resource_id": {"readonly": True}, + } + + _attribute_map = { + "network": {"key": "network", "type": "MachineNetworkProperties"}, + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.network = None + self.resource_id = None + + +class MaintenanceConfiguration(SubResource): + """See `planned maintenance `_ for more + information about planned maintenance. + + 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.v2024_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.v2024_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.v2024_02_02_preview.models.TimeSpan] + :ivar maintenance_window: Maintenance window for the maintenance configuration. + :vartype maintenance_window: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.MaintenanceWindow + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "time_in_week": {"key": "properties.timeInWeek", "type": "[TimeInWeek]"}, + "not_allowed_time": {"key": "properties.notAllowedTime", "type": "[TimeSpan]"}, + "maintenance_window": {"key": "properties.maintenanceWindow", "type": "MaintenanceWindow"}, + } + + def __init__( + self, + *, + time_in_week: Optional[List["_models.TimeInWeek"]] = None, + not_allowed_time: Optional[List["_models.TimeSpan"]] = None, + maintenance_window: Optional["_models.MaintenanceWindow"] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_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.v2024_02_02_preview.models.TimeSpan] + :keyword maintenance_window: Maintenance window for the maintenance configuration. + :paramtype maintenance_window: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.MaintenanceWindow + """ + super().__init__(**kwargs) + self.system_data = None + self.time_in_week = time_in_week + self.not_allowed_time = not_allowed_time + self.maintenance_window = maintenance_window + + +class MaintenanceConfigurationListResult(_serialization.Model): + """The response from the List maintenance configurations operation. + + 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.v2024_02_02_preview.models.MaintenanceConfiguration] + :ivar next_link: The URL to get the next set of maintenance configuration results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MaintenanceConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.MaintenanceConfiguration"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.MaintenanceConfiguration] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MaintenanceWindow(_serialization.Model): + """Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + + 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.v2024_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' + for PST. If not specified, the default is '+00:00'. + :vartype utc_offset: str + :ivar start_date: The date the maintenance window activates. If the current date is before this + date, the maintenance window is inactive and will not be used for upgrades. If not specified, + the maintenance window will be active right away. + :vartype start_date: ~datetime.date + :ivar start_time: The start time of the maintenance window. Accepted values are from '00:00' to + '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means + UTC time '00:00'. Required. + :vartype start_time: str + :ivar not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to + 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.v2024_02_02_preview.models.DateSpan] + """ + + _validation = { + "schedule": {"required": True}, + "duration_hours": {"required": True, "maximum": 24, "minimum": 4}, + "utc_offset": {"pattern": r"^(-|\+)[0-9]{2}:[0-9]{2}$"}, + "start_time": {"required": True, "pattern": r"^\d{2}:\d{2}$"}, + } + + _attribute_map = { + "schedule": {"key": "schedule", "type": "Schedule"}, + "duration_hours": {"key": "durationHours", "type": "int"}, + "utc_offset": {"key": "utcOffset", "type": "str"}, + "start_date": {"key": "startDate", "type": "date"}, + "start_time": {"key": "startTime", "type": "str"}, + "not_allowed_dates": {"key": "notAllowedDates", "type": "[DateSpan]"}, + } + + def __init__( + self, + *, + schedule: "_models.Schedule", + duration_hours: int = 24, + start_time: str, + utc_offset: Optional[str] = None, + start_date: Optional[datetime.date] = None, + not_allowed_dates: Optional[List["_models.DateSpan"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword schedule: Recurrence schedule for the maintenance window. Required. + :paramtype schedule: ~azure.mgmt.containerservice.v2024_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 + '-07:00' for PST. If not specified, the default is '+00:00'. + :paramtype utc_offset: str + :keyword start_date: The date the maintenance window activates. If the current date is before + this date, the maintenance window is inactive and will not be used for upgrades. If not + specified, the maintenance window will be active right away. + :paramtype start_date: ~datetime.date + :keyword start_time: The start time of the maintenance window. Accepted values are from '00:00' + to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' + means UTC time '00:00'. Required. + :paramtype start_time: str + :keyword not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to + 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.v2024_02_02_preview.models.DateSpan] + """ + super().__init__(**kwargs) + self.schedule = schedule + self.duration_hours = duration_hours + self.utc_offset = utc_offset + self.start_date = start_date + self.start_time = start_time + self.not_allowed_dates = not_allowed_dates + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_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 + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": 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}"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) + self.tags = tags + self.location = location + + +class ManagedCluster(TrackedResource): # pylint: disable=too-many-instance-attributes + """Managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_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 sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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 + 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 1.14.x -> + 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :vartype kubernetes_version: str + :ivar current_kubernetes_version: The version of Kubernetes the Managed Cluster is running. + :vartype current_kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str + :ivar fqdn: The FQDN of the master pool. + :vartype fqdn: str + :ivar private_fqdn: The FQDN of private cluster. + :vartype private_fqdn: str + :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) + headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. + This special FQDN supports CORS, allowing the Azure Portal to function properly. + :vartype azure_portal_fqdn: str + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAgentPoolProfile] + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ContainerServiceLinuxProfile + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterServicePrincipalProfile + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterPodIdentityProfile + :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :vartype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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. + :vartype enable_pod_security_policy: bool + :ivar enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updating of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource. + :vartype enable_namespace_resources: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ContainerServiceNetworkProfile + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAutoUpgradeProfile + :ivar upgrade_settings: Settings for upgrading a cluster. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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 + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2024_02_02_preview.models.UserAssignedIdentity] + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: + list[~azure.mgmt.containerservice.v2024_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 + `_. + :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.v2024_02_02_preview.models.ManagedClusterHTTPProxyConfig + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSecurityProfile + :ivar storage_profile: Storage profile for the managed cluster. + :vartype storage_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfile + :ivar ingress_profile: Ingress profile for the managed cluster. + :vartype ingress_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + :ivar azure_monitor_profile: Prometheus addon profile for the container service cluster. + :vartype azure_monitor_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.SafeguardsProfile + :ivar service_mesh_profile: Service mesh profile for a managed cluster. + :vartype service_mesh_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterNodeProvisioningProfile + :ivar bootstrap_profile: Profile of the cluster bootstrap configuration. + :vartype bootstrap_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterBootstrapProfile + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "power_state": {"readonly": True}, + "max_agent_pools": {"readonly": True}, + "current_kubernetes_version": {"readonly": True}, + "fqdn": {"readonly": True}, + "private_fqdn": {"readonly": True}, + "azure_portal_fqdn": {"readonly": True}, + "resource_uid": {"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}"}, + "location": {"key": "location", "type": "str"}, + "sku": {"key": "sku", "type": "ManagedClusterSKU"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "identity": {"key": "identity", "type": "ManagedClusterIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "power_state": {"key": "properties.powerState", "type": "PowerState"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "max_agent_pools": {"key": "properties.maxAgentPools", "type": "int"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "current_kubernetes_version": {"key": "properties.currentKubernetesVersion", "type": "str"}, + "dns_prefix": {"key": "properties.dnsPrefix", "type": "str"}, + "fqdn_subdomain": {"key": "properties.fqdnSubdomain", "type": "str"}, + "fqdn": {"key": "properties.fqdn", "type": "str"}, + "private_fqdn": {"key": "properties.privateFQDN", "type": "str"}, + "azure_portal_fqdn": {"key": "properties.azurePortalFQDN", "type": "str"}, + "agent_pool_profiles": {"key": "properties.agentPoolProfiles", "type": "[ManagedClusterAgentPoolProfile]"}, + "linux_profile": {"key": "properties.linuxProfile", "type": "ContainerServiceLinuxProfile"}, + "windows_profile": {"key": "properties.windowsProfile", "type": "ManagedClusterWindowsProfile"}, + "service_principal_profile": { + "key": "properties.servicePrincipalProfile", + "type": "ManagedClusterServicePrincipalProfile", + }, + "addon_profiles": {"key": "properties.addonProfiles", "type": "{ManagedClusterAddonProfile}"}, + "pod_identity_profile": {"key": "properties.podIdentityProfile", "type": "ManagedClusterPodIdentityProfile"}, + "oidc_issuer_profile": {"key": "properties.oidcIssuerProfile", "type": "ManagedClusterOIDCIssuerProfile"}, + "node_resource_group": {"key": "properties.nodeResourceGroup", "type": "str"}, + "node_resource_group_profile": { + "key": "properties.nodeResourceGroupProfile", + "type": "ManagedClusterNodeResourceGroupProfile", + }, + "enable_rbac": {"key": "properties.enableRBAC", "type": "bool"}, + "support_plan": {"key": "properties.supportPlan", "type": "str"}, + "enable_pod_security_policy": {"key": "properties.enablePodSecurityPolicy", "type": "bool"}, + "enable_namespace_resources": {"key": "properties.enableNamespaceResources", "type": "bool"}, + "network_profile": {"key": "properties.networkProfile", "type": "ContainerServiceNetworkProfile"}, + "aad_profile": {"key": "properties.aadProfile", "type": "ManagedClusterAADProfile"}, + "auto_upgrade_profile": {"key": "properties.autoUpgradeProfile", "type": "ManagedClusterAutoUpgradeProfile"}, + "upgrade_settings": {"key": "properties.upgradeSettings", "type": "ClusterUpgradeSettings"}, + "auto_scaler_profile": { + "key": "properties.autoScalerProfile", + "type": "ManagedClusterPropertiesAutoScalerProfile", + }, + "api_server_access_profile": { + "key": "properties.apiServerAccessProfile", + "type": "ManagedClusterAPIServerAccessProfile", + }, + "disk_encryption_set_id": {"key": "properties.diskEncryptionSetID", "type": "str"}, + "identity_profile": {"key": "properties.identityProfile", "type": "{UserAssignedIdentity}"}, + "private_link_resources": {"key": "properties.privateLinkResources", "type": "[PrivateLinkResource]"}, + "disable_local_accounts": {"key": "properties.disableLocalAccounts", "type": "bool"}, + "http_proxy_config": {"key": "properties.httpProxyConfig", "type": "ManagedClusterHTTPProxyConfig"}, + "security_profile": {"key": "properties.securityProfile", "type": "ManagedClusterSecurityProfile"}, + "storage_profile": {"key": "properties.storageProfile", "type": "ManagedClusterStorageProfile"}, + "ingress_profile": {"key": "properties.ingressProfile", "type": "ManagedClusterIngressProfile"}, + "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "workload_auto_scaler_profile": { + "key": "properties.workloadAutoScalerProfile", + "type": "ManagedClusterWorkloadAutoScalerProfile", + }, + "azure_monitor_profile": {"key": "properties.azureMonitorProfile", "type": "ManagedClusterAzureMonitorProfile"}, + "safeguards_profile": {"key": "properties.safeguardsProfile", "type": "SafeguardsProfile"}, + "service_mesh_profile": {"key": "properties.serviceMeshProfile", "type": "ServiceMeshProfile"}, + "resource_uid": {"key": "properties.resourceUID", "type": "str"}, + "metrics_profile": {"key": "properties.metricsProfile", "type": "ManagedClusterMetricsProfile"}, + "ai_toolchain_operator_profile": { + "key": "properties.aiToolchainOperatorProfile", + "type": "ManagedClusterAIToolchainOperatorProfile", + }, + "node_provisioning_profile": { + "key": "properties.nodeProvisioningProfile", + "type": "ManagedClusterNodeProvisioningProfile", + }, + "bootstrap_profile": {"key": "properties.bootstrapProfile", "type": "ManagedClusterBootstrapProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["_models.ManagedClusterSKU"] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + identity: Optional["_models.ManagedClusterIdentity"] = None, + kind: Optional[str] = None, + creation_data: Optional["_models.CreationData"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + fqdn_subdomain: Optional[str] = None, + agent_pool_profiles: Optional[List["_models.ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["_models.ContainerServiceLinuxProfile"] = None, + windows_profile: Optional["_models.ManagedClusterWindowsProfile"] = None, + service_principal_profile: Optional["_models.ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "_models.ManagedClusterAddonProfile"]] = None, + pod_identity_profile: Optional["_models.ManagedClusterPodIdentityProfile"] = None, + oidc_issuer_profile: Optional["_models.ManagedClusterOIDCIssuerProfile"] = None, + node_resource_group: Optional[str] = None, + 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, + enable_namespace_resources: Optional[bool] = None, + network_profile: Optional["_models.ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["_models.ManagedClusterAADProfile"] = None, + auto_upgrade_profile: Optional["_models.ManagedClusterAutoUpgradeProfile"] = None, + upgrade_settings: Optional["_models.ClusterUpgradeSettings"] = None, + auto_scaler_profile: Optional["_models.ManagedClusterPropertiesAutoScalerProfile"] = None, + api_server_access_profile: Optional["_models.ManagedClusterAPIServerAccessProfile"] = None, + disk_encryption_set_id: Optional[str] = None, + identity_profile: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + private_link_resources: Optional[List["_models.PrivateLinkResource"]] = None, + disable_local_accounts: Optional[bool] = None, + http_proxy_config: Optional["_models.ManagedClusterHTTPProxyConfig"] = None, + security_profile: Optional["_models.ManagedClusterSecurityProfile"] = None, + storage_profile: Optional["_models.ManagedClusterStorageProfile"] = None, + ingress_profile: Optional["_models.ManagedClusterIngressProfile"] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, + workload_auto_scaler_profile: Optional["_models.ManagedClusterWorkloadAutoScalerProfile"] = None, + azure_monitor_profile: Optional["_models.ManagedClusterAzureMonitorProfile"] = None, + safeguards_profile: Optional["_models.SafeguardsProfile"] = None, + service_mesh_profile: Optional["_models.ServiceMeshProfile"] = None, + metrics_profile: Optional["_models.ManagedClusterMetricsProfile"] = None, + ai_toolchain_operator_profile: Optional["_models.ManagedClusterAIToolchainOperatorProfile"] = None, + node_provisioning_profile: Optional["_models.ManagedClusterNodeProvisioningProfile"] = None, + bootstrap_profile: Optional["_models.ManagedClusterBootstrapProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: + ~azure.mgmt.containerservice.v2024_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.v2024_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 + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterPodIdentityProfile + :keyword oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :paramtype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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. + :paramtype enable_pod_security_policy: bool + :keyword enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updating of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource. + :paramtype enable_namespace_resources: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAutoUpgradeProfile + :keyword upgrade_settings: Settings for upgrading a cluster. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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 + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2024_02_02_preview.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2024_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 + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSecurityProfile + :keyword storage_profile: Storage profile for the managed cluster. + :paramtype storage_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfile + :keyword ingress_profile: Ingress profile for the managed cluster. + :paramtype ingress_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + :keyword azure_monitor_profile: Prometheus addon profile for the container service cluster. + :paramtype azure_monitor_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.SafeguardsProfile + :keyword service_mesh_profile: Service mesh profile for a managed cluster. + :paramtype service_mesh_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ServiceMeshProfile + :keyword metrics_profile: Optional cluster metrics configuration. + :paramtype metrics_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterNodeProvisioningProfile + :keyword bootstrap_profile: Profile of the cluster bootstrap configuration. + :paramtype bootstrap_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterBootstrapProfile + """ + super().__init__(tags=tags, location=location, **kwargs) + self.sku = sku + self.extended_location = extended_location + self.identity = identity + self.kind = kind + self.provisioning_state = None + self.power_state = None + self.creation_data = creation_data + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.current_kubernetes_version = None + self.dns_prefix = dns_prefix + self.fqdn_subdomain = fqdn_subdomain + self.fqdn = None + self.private_fqdn = None + self.azure_portal_fqdn = None + self.agent_pool_profiles = agent_pool_profiles + self.linux_profile = linux_profile + self.windows_profile = windows_profile + self.service_principal_profile = service_principal_profile + self.addon_profiles = addon_profiles + self.pod_identity_profile = pod_identity_profile + self.oidc_issuer_profile = oidc_issuer_profile + self.node_resource_group = node_resource_group + 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.enable_namespace_resources = enable_namespace_resources + self.network_profile = network_profile + self.aad_profile = aad_profile + self.auto_upgrade_profile = auto_upgrade_profile + self.upgrade_settings = upgrade_settings + self.auto_scaler_profile = auto_scaler_profile + self.api_server_access_profile = api_server_access_profile + self.disk_encryption_set_id = disk_encryption_set_id + self.identity_profile = identity_profile + self.private_link_resources = private_link_resources + self.disable_local_accounts = disable_local_accounts + self.http_proxy_config = http_proxy_config + self.security_profile = security_profile + self.storage_profile = storage_profile + self.ingress_profile = ingress_profile + self.public_network_access = public_network_access + self.workload_auto_scaler_profile = workload_auto_scaler_profile + self.azure_monitor_profile = azure_monitor_profile + self.safeguards_profile = safeguards_profile + self.service_mesh_profile = service_mesh_profile + self.resource_uid = None + self.metrics_profile = metrics_profile + self.ai_toolchain_operator_profile = ai_toolchain_operator_profile + self.node_provisioning_profile = node_provisioning_profile + self.bootstrap_profile = bootstrap_profile + + +class ManagedClusterAADProfile(_serialization.Model): + """For more details see `managed AAD on AKS `_. + + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: (DEPRECATED) The client AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype client_app_id: str + :ivar server_app_id: (DEPRECATED) The server AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype server_app_id: str + :ivar server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :vartype tenant_id: str + """ + + _attribute_map = { + "managed": {"key": "managed", "type": "bool"}, + "enable_azure_rbac": {"key": "enableAzureRBAC", "type": "bool"}, + "admin_group_object_i_ds": {"key": "adminGroupObjectIDs", "type": "[str]"}, + "client_app_id": {"key": "clientAppID", "type": "str"}, + "server_app_id": {"key": "serverAppID", "type": "str"}, + "server_app_secret": {"key": "serverAppSecret", "type": "str"}, + "tenant_id": {"key": "tenantID", "type": "str"}, + } + + def __init__( + self, + *, + managed: Optional[bool] = None, + enable_azure_rbac: Optional[bool] = None, + admin_group_object_i_ds: Optional[List[str]] = None, + client_app_id: Optional[str] = None, + server_app_id: Optional[str] = None, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: (DEPRECATED) The client AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype client_app_id: str + :keyword server_app_id: (DEPRECATED) The server AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype server_app_id: str + :keyword server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ + super().__init__(**kwargs) + self.managed = managed + self.enable_azure_rbac = enable_azure_rbac + self.admin_group_object_i_ds = admin_group_object_i_ds + self.client_app_id = client_app_id + self.server_app_id = server_app_id + self.server_app_secret = server_app_secret + self.tenant_id = tenant_id + + +class ManagedClusterAccessProfile(TrackedResource): + """Managed cluster Access Profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_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 kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytes + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": 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}"}, + "location": {"key": "location", "type": "str"}, + "kube_config": {"key": "properties.kubeConfig", "type": "bytearray"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytes] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytes + """ + super().__init__(tags=tags, location=location, **kwargs) + self.kube_config = kube_config + + +class ManagedClusterAddonProfile(_serialization.Model): + """A Kubernetes add-on profile for a managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether the add-on is enabled or not. Required. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] + :ivar identity: Information of user assigned identity used by this add-on. + :vartype identity: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAddonProfileIdentity + """ + + _validation = { + "enabled": {"required": True}, + "identity": {"readonly": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "config": {"key": "config", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedClusterAddonProfileIdentity"}, + } + + def __init__(self, *, enabled: bool, config: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether the add-on is enabled or not. Required. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.config = config + self.identity = None + + +class UserAssignedIdentity(_serialization.Model): + """Details about a user assigned identity. + + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.client_id = client_id + self.object_id = object_id + + +class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): + """Information of user assigned identity used by this add-on. + + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str + """ + + +class ManagedClusterAgentPoolProfileProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Properties for the container service agent pool profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_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.v2024_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.v2024_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_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.v2024_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.v2024_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_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.v2024_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.v2024_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_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.v2024_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_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.v2024_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_02_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_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.v2024_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 + 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.v2024_02_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.AgentPoolGatewayProfile + """ + + _validation = { + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "maxPods", "type": "int"}, + "os_type": {"key": "osType", "type": "str"}, + "os_sku": {"key": "osSKU", "type": "str"}, + "max_count": {"key": "maxCount", "type": "int"}, + "min_count": {"key": "minCount", "type": "int"}, + "enable_auto_scaling": {"key": "enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "scaleDownMode", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "power_state": {"key": "powerState", "type": "PowerState"}, + "availability_zones": {"key": "availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "spotMaxPrice", "type": "float"}, + "tags": {"key": "tags", "type": "{str}"}, + "node_labels": {"key": "nodeLabels", "type": "{str}"}, + "node_taints": {"key": "nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "hostGroupID", "type": "str"}, + "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, + "virtual_machines_profile": {"key": "virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": {"key": "virtualMachineNodesStatus", "type": "[VirtualMachineNodes]"}, + "gateway_profile": {"key": "gatewayProfile", "type": "AgentPoolGatewayProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_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.v2024_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.v2024_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_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.v2024_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.v2024_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_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.v2024_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.v2024_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_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.v2024_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_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.v2024_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_02_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_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.v2024_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 + 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.v2024_02_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.AgentPoolGatewayProfile + """ + super().__init__(**kwargs) + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.message_of_the_day = message_of_the_day + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.pod_ip_allocation_mode = pod_ip_allocation_mode + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type = type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.current_orchestrator_version = None + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = power_state + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.enable_custom_ca_trust = enable_custom_ca_trust + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.node_initialization_taints = node_initialization_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + self.capacity_reservation_group_id = capacity_reservation_group_id + self.host_group_id = host_group_id + self.windows_profile = windows_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.gpu_profile = gpu_profile + self.artifact_streaming_profile = artifact_streaming_profile + self.virtual_machines_profile = virtual_machines_profile + self.virtual_machine_nodes_status = virtual_machine_nodes_status + self.gateway_profile = gateway_profile + + +class ManagedClusterAgentPoolProfile( + ManagedClusterAgentPoolProfileProperties +): # pylint: disable=too-many-instance-attributes + """Profile for the container service agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_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.v2024_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.v2024_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_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.v2024_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.v2024_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_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.v2024_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.v2024_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_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.v2024_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_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.v2024_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_02_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_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.v2024_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 + 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.v2024_02_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.AgentPoolGatewayProfile + :ivar name: Windows agent pool names must be 6 characters or less. Required. + :vartype name: str + """ + + _validation = { + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "name": {"required": True, "pattern": r"^[a-z][a-z0-9]{0,11}$"}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "maxPods", "type": "int"}, + "os_type": {"key": "osType", "type": "str"}, + "os_sku": {"key": "osSKU", "type": "str"}, + "max_count": {"key": "maxCount", "type": "int"}, + "min_count": {"key": "minCount", "type": "int"}, + "enable_auto_scaling": {"key": "enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "scaleDownMode", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "power_state": {"key": "powerState", "type": "PowerState"}, + "availability_zones": {"key": "availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "spotMaxPrice", "type": "float"}, + "tags": {"key": "tags", "type": "{str}"}, + "node_labels": {"key": "nodeLabels", "type": "{str}"}, + "node_taints": {"key": "nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "hostGroupID", "type": "str"}, + "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, + "virtual_machines_profile": {"key": "virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": {"key": "virtualMachineNodesStatus", "type": "[VirtualMachineNodes]"}, + "gateway_profile": {"key": "gatewayProfile", "type": "AgentPoolGatewayProfile"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_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.v2024_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.v2024_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_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.v2024_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.v2024_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_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.v2024_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.v2024_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_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.v2024_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_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.v2024_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_02_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_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.v2024_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 + 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.v2024_02_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.AgentPoolGatewayProfile + :keyword name: Windows agent pool names must be 6 characters or less. Required. + :paramtype name: str + """ + super().__init__( + count=count, + vm_size=vm_size, + os_disk_size_gb=os_disk_size_gb, + os_disk_type=os_disk_type, + kubelet_disk_type=kubelet_disk_type, + workload_runtime=workload_runtime, + message_of_the_day=message_of_the_day, + vnet_subnet_id=vnet_subnet_id, + pod_subnet_id=pod_subnet_id, + pod_ip_allocation_mode=pod_ip_allocation_mode, + max_pods=max_pods, + os_type=os_type, + os_sku=os_sku, + max_count=max_count, + min_count=min_count, + enable_auto_scaling=enable_auto_scaling, + scale_down_mode=scale_down_mode, + type=type, + mode=mode, + orchestrator_version=orchestrator_version, + upgrade_settings=upgrade_settings, + power_state=power_state, + availability_zones=availability_zones, + enable_node_public_ip=enable_node_public_ip, + enable_custom_ca_trust=enable_custom_ca_trust, + node_public_ip_prefix_id=node_public_ip_prefix_id, + scale_set_priority=scale_set_priority, + scale_set_eviction_policy=scale_set_eviction_policy, + spot_max_price=spot_max_price, + tags=tags, + node_labels=node_labels, + node_taints=node_taints, + node_initialization_taints=node_initialization_taints, + proximity_placement_group_id=proximity_placement_group_id, + kubelet_config=kubelet_config, + linux_os_config=linux_os_config, + enable_encryption_at_host=enable_encryption_at_host, + enable_ultra_ssd=enable_ultra_ssd, + enable_fips=enable_fips, + gpu_instance_profile=gpu_instance_profile, + creation_data=creation_data, + capacity_reservation_group_id=capacity_reservation_group_id, + host_group_id=host_group_id, + windows_profile=windows_profile, + network_profile=network_profile, + security_profile=security_profile, + gpu_profile=gpu_profile, + artifact_streaming_profile=artifact_streaming_profile, + virtual_machines_profile=virtual_machines_profile, + virtual_machine_nodes_status=virtual_machine_nodes_status, + gateway_profile=gateway_profile, + **kwargs + ) + self.name = name + + +class ManagedClusterAIToolchainOperatorProfile(_serialization.Model): + """When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the + cluster. The operator automates the deployment of OSS models for inference and/or training + purposes. It provides a set of preset models and enables distributed inference against them. + + :ivar enabled: Indicates if AI toolchain operator enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if AI toolchain operator enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterAPIServerAccessProfile(_serialization.Model): + """Access profile for managed cluster API server. + + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + cluster or not. + :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. + :vartype enable_vnet_integration: bool + :ivar subnet_id: It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an + existing cluster to enable apiserver vnet integration. + :vartype subnet_id: str + """ + + _attribute_map = { + "authorized_ip_ranges": {"key": "authorizedIPRanges", "type": "[str]"}, + "enable_private_cluster": {"key": "enablePrivateCluster", "type": "bool"}, + "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__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + 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: + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :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. + :paramtype enable_vnet_integration: bool + :keyword subnet_id: It is required when: 1. creating a new cluster with BYO Vnet; 2. updating + an existing cluster to enable apiserver vnet integration. + :paramtype subnet_id: str + """ + super().__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + 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): + """Auto upgrade profile for a managed cluster. + + :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.v2024_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.v2024_02_02_preview.models.NodeOSUpgradeChannel + """ + + _attribute_map = { + "upgrade_channel": {"key": "upgradeChannel", "type": "str"}, + "node_os_upgrade_channel": {"key": "nodeOSUpgradeChannel", "type": "str"}, + } + + def __init__( + self, + *, + upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = None, + node_os_upgrade_channel: Optional[Union[str, "_models.NodeOSUpgradeChannel"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Known values are: "rapid", "stable", "patch", "node-image", and "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.NodeOSUpgradeChannel + """ + super().__init__(**kwargs) + self.upgrade_channel = upgrade_channel + self.node_os_upgrade_channel = node_os_upgrade_channel + + +class ManagedClusterAzureMonitorProfile(_serialization.Model): + """Prometheus addon profile for the container service cluster. + + :ivar metrics: Metrics profile for the prometheus service addon. + :vartype metrics: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring + """ + + _attribute_map = { + "metrics": {"key": "metrics", "type": "ManagedClusterAzureMonitorProfileMetrics"}, + "container_insights": { + "key": "containerInsights", + "type": "ManagedClusterAzureMonitorProfileContainerInsights", + }, + "app_monitoring": {"key": "appMonitoring", "type": "ManagedClusterAzureMonitorProfileAppMonitoring"}, + } + + def __init__( + self, + *, + metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = None, + container_insights: Optional["_models.ManagedClusterAzureMonitorProfileContainerInsights"] = None, + app_monitoring: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoring"] = None, + **kwargs: Any + ) -> None: + """ + :keyword metrics: Metrics profile for the prometheus service addon. + :paramtype metrics: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring + """ + super().__init__(**kwargs) + self.metrics = metrics + self.container_insights = container_insights + self.app_monitoring = app_monitoring + + +class ManagedClusterAzureMonitorProfileAppMonitoring(_serialization.Model): # pylint: disable=name-too-long + """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. + + :ivar auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes + Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based + SDKs to collect OpenTelemetry metrics, logs and traces of the application. See + aka.ms/AzureMonitorApplicationMonitoring for an overview. + :vartype auto_instrumentation: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation # pylint: disable=line-too-long + :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.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics # pylint: disable=line-too-long + :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.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs # pylint: disable=line-too-long + """ + + _attribute_map = { + "auto_instrumentation": { + "key": "autoInstrumentation", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation", + }, + "open_telemetry_metrics": { + "key": "openTelemetryMetrics", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics", + }, + "open_telemetry_logs": { + "key": "openTelemetryLogs", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs", + }, + } + + def __init__( + self, + *, + auto_instrumentation: Optional[ + "_models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation" + ] = None, + open_telemetry_metrics: Optional[ + "_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics" + ] = None, + open_telemetry_logs: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs"] = None, + **kwargs: Any + ) -> None: + """ + :keyword auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes + Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based + SDKs to collect OpenTelemetry metrics, logs and traces of the application. See + aka.ms/AzureMonitorApplicationMonitoring for an overview. + :paramtype auto_instrumentation: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation # pylint: disable=line-too-long + :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.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics # pylint: disable=line-too-long + :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.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.auto_instrumentation = auto_instrumentation + self.open_telemetry_metrics = open_telemetry_metrics + self.open_telemetry_logs = open_telemetry_logs + + +class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation( + _serialization.Model +): # pylint: disable=name-too-long + """Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web + hook to auto-instrument Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry + metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for + an overview. + + :ivar enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs( + _serialization.Model +): # pylint: disable=name-too-long + """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. + + :ivar enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or + not. + :vartype enabled: bool + :ivar port: The Open Telemetry host port for Open Telemetry logs and traces. If not specified, + the default port is 28331. + :vartype port: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled + or not. + :paramtype enabled: bool + :keyword port: The Open Telemetry host port for Open Telemetry logs and traces. If not + specified, the default port is 28331. + :paramtype port: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.port = port + + +class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics( + _serialization.Model +): # pylint: disable=name-too-long + """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. + + :ivar enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + :vartype enabled: bool + :ivar port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the + default port is 28333. + :vartype port: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + :paramtype enabled: bool + :keyword port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the + default port is 28333. + :paramtype port: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.port = port + + +class ManagedClusterAzureMonitorProfileContainerInsights(_serialization.Model): # pylint: disable=name-too-long + """Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout + & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview. + + :ivar enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log + Analytics Workspace for storing Azure Monitor Container Insights Logs. + :vartype log_analytics_workspace_resource_id: str + :ivar syslog_port: The syslog host port. If not specified, the default port is 28330. + :vartype syslog_port: int + :ivar disable_custom_metrics: Indicates whether custom metrics collection has to be disabled or + not. If not specified the default is false. No custom metrics will be emitted if this field is + false but the container insights enabled field is false. + :vartype disable_custom_metrics: bool + :ivar disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is + disabled or not. If not specified the default is false. No prometheus metrics will be emitted + if this field is false but the container insights enabled field is false. + :vartype disable_prometheus_metrics_scraping: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, + "syslog_port": {"key": "syslogPort", "type": "int"}, + "disable_custom_metrics": {"key": "disableCustomMetrics", "type": "bool"}, + "disable_prometheus_metrics_scraping": {"key": "disablePrometheusMetricsScraping", "type": "bool"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + log_analytics_workspace_resource_id: Optional[str] = None, + syslog_port: Optional[int] = None, + disable_custom_metrics: Optional[bool] = None, + disable_prometheus_metrics_scraping: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + :paramtype enabled: bool + :keyword log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log + Analytics Workspace for storing Azure Monitor Container Insights Logs. + :paramtype log_analytics_workspace_resource_id: str + :keyword syslog_port: The syslog host port. If not specified, the default port is 28330. + :paramtype syslog_port: int + :keyword disable_custom_metrics: Indicates whether custom metrics collection has to be disabled + or not. If not specified the default is false. No custom metrics will be emitted if this field + is false but the container insights enabled field is false. + :paramtype disable_custom_metrics: bool + :keyword disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is + disabled or not. If not specified the default is false. No prometheus metrics will be emitted + if this field is false but the container insights enabled field is false. + :paramtype disable_prometheus_metrics_scraping: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + self.syslog_port = syslog_port + self.disable_custom_metrics = disable_custom_metrics + self.disable_prometheus_metrics_scraping = disable_prometheus_metrics_scraping + + +class ManagedClusterAzureMonitorProfileKubeStateMetrics(_serialization.Model): # pylint: disable=name-too-long + """Kube State Metrics for prometheus addon profile for the container service cluster. + + :ivar metric_labels_allowlist: Comma-separated list of Kubernetes annotations keys that will be + used in the resource's labels metric. + :vartype metric_labels_allowlist: str + :ivar metric_annotations_allow_list: Comma-separated list of additional Kubernetes label keys + that will be used in the resource's labels metric. + :vartype metric_annotations_allow_list: str + """ + + _attribute_map = { + "metric_labels_allowlist": {"key": "metricLabelsAllowlist", "type": "str"}, + "metric_annotations_allow_list": {"key": "metricAnnotationsAllowList", "type": "str"}, + } + + def __init__( + self, + *, + metric_labels_allowlist: Optional[str] = None, + metric_annotations_allow_list: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword metric_labels_allowlist: Comma-separated list of Kubernetes annotations keys that will + be used in the resource's labels metric. + :paramtype metric_labels_allowlist: str + :keyword metric_annotations_allow_list: Comma-separated list of additional Kubernetes label + keys that will be used in the resource's labels metric. + :paramtype metric_annotations_allow_list: str + """ + super().__init__(**kwargs) + self.metric_labels_allowlist = metric_labels_allowlist + self.metric_annotations_allow_list = metric_annotations_allow_list + + +class ManagedClusterAzureMonitorProfileMetrics(_serialization.Model): + """Metrics profile for the prometheus service addon. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable the Prometheus collector. Required. + :vartype enabled: bool + :ivar kube_state_metrics: Kube State Metrics for prometheus addon profile for the container + service cluster. + :vartype kube_state_metrics: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "kube_state_metrics": {"key": "kubeStateMetrics", "type": "ManagedClusterAzureMonitorProfileKubeStateMetrics"}, + } + + def __init__( + self, + *, + enabled: bool, + kube_state_metrics: Optional["_models.ManagedClusterAzureMonitorProfileKubeStateMetrics"] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable the Prometheus collector. Required. + :paramtype enabled: bool + :keyword kube_state_metrics: Kube State Metrics for prometheus addon profile for the container + service cluster. + :paramtype kube_state_metrics: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + """ + super().__init__(**kwargs) + self.enabled = enabled + self.kube_state_metrics = kube_state_metrics + + +class ManagedClusterBootstrapProfile(_serialization.Model): + """The bootstrap profile. + + :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.v2024_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 + """ + + _attribute_map = { + "artifact_source": {"key": "artifactSource", "type": "str"}, + "container_registry_id": {"key": "containerRegistryId", "type": "str"}, + } + + def __init__( + self, + *, + artifact_source: Union[str, "_models.ArtifactSource"] = "Direct", + container_registry_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_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 + """ + super().__init__(**kwargs) + self.artifact_source = artifact_source + self.container_registry_id = container_registry_id + + +class ManagedClusterCostAnalysis(_serialization.Model): + """The cost analysis configuration for the cluster. + + :ivar enabled: The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable + this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost + Analysis views in the Azure portal. If not specified, the default is false. For more + information see aka.ms/aks/docs/cost-analysis. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable + this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost + Analysis views in the Azure portal. If not specified, the default is false. For more + information see aka.ms/aks/docs/cost-analysis. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterHTTPProxyConfig(_serialization.Model): + """Cluster HTTP proxy configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar effective_no_proxy: A read-only list of all endpoints for which traffic should not be + sent to the proxy. This list is a superset of noProxy and values injected by AKS. + :vartype effective_no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str + """ + + _validation = { + "effective_no_proxy": {"readonly": True}, + } + + _attribute_map = { + "http_proxy": {"key": "httpProxy", "type": "str"}, + "https_proxy": {"key": "httpsProxy", "type": "str"}, + "no_proxy": {"key": "noProxy", "type": "[str]"}, + "effective_no_proxy": {"key": "effectiveNoProxy", "type": "[str]"}, + "trusted_ca": {"key": "trustedCa", "type": "str"}, + } + + def __init__( + self, + *, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, + no_proxy: Optional[List[str]] = None, + trusted_ca: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ + super().__init__(**kwargs) + self.http_proxy = http_proxy + self.https_proxy = https_proxy + self.no_proxy = no_proxy + self.effective_no_proxy = None + self.trusted_ca = trusted_ca + + +class ManagedClusterIdentity(_serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by master + components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by master + components. + :vartype tenant_id: str + :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.v2024_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.v2024_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 + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "delegated_resources": {"key": "delegatedResources", "type": "{DelegatedResource}"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{ManagedServiceIdentityUserAssignedIdentitiesValue}", + }, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, + delegated_resources: Optional[Dict[str, "_models.DelegatedResource"]] = None, + user_assigned_identities: Optional[ + Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"] + ] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_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.v2024_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 + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.delegated_resources = delegated_resources + self.user_assigned_identities = user_assigned_identities + + +class ManagedClusterIngressProfile(_serialization.Model): + """Ingress profile for the container service cluster. + + :ivar web_app_routing: Web App Routing settings for the ingress profile. + :vartype web_app_routing: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterIngressProfileWebAppRouting + """ + + _attribute_map = { + "web_app_routing": {"key": "webAppRouting", "type": "ManagedClusterIngressProfileWebAppRouting"}, + } + + def __init__( + self, *, web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = None, **kwargs: Any + ) -> None: + """ + :keyword web_app_routing: Web App Routing settings for the ingress profile. + :paramtype web_app_routing: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterIngressProfileWebAppRouting + """ + super().__init__(**kwargs) + self.web_app_routing = web_app_routing + + +class ManagedClusterIngressProfileWebAppRouting(_serialization.Model): # pylint: disable=name-too-long + """Web App Routing settings for the ingress profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar enabled: Whether to enable Web App Routing. + :vartype enabled: bool + :ivar dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the Web App + Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be + in different resource groups, but all public DNS zones must be in the same resource group and + all private DNS zones must be in the same resource group. + :vartype dns_zone_resource_ids: list[str] + :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.v2024_02_02_preview.models.UserAssignedIdentity + """ + + _validation = { + "dns_zone_resource_ids": {"max_items": 5, "min_items": 0}, + "identity": {"readonly": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "dns_zone_resource_ids": {"key": "dnsZoneResourceIds", "type": "[str]"}, + "identity": {"key": "identity", "type": "UserAssignedIdentity"}, + } + + def __init__( + self, *, enabled: Optional[bool] = None, dns_zone_resource_ids: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable Web App Routing. + :paramtype enabled: bool + :keyword dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the Web App + Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be + in different resource groups, but all public DNS zones must be in the same resource group and + all private DNS zones must be in the same resource group. + :paramtype dns_zone_resource_ids: list[str] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.dns_zone_resource_ids = dns_zone_resource_ids + self.identity = None + + +class ManagedClusterListResult(_serialization.Model): + """The response from the List Managed Clusters operation. + + 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.v2024_02_02_preview.models.ManagedCluster] + :ivar next_link: The URL to get the next set of managed cluster results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ManagedCluster]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_02_02_preview.models.ManagedCluster] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(_serialization.Model): + """Profile of the managed cluster load balancer. + + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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.v2024_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. + :vartype allocated_outbound_ports: int + :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 30 minutes. + :vartype idle_timeout_in_minutes: int + :ivar enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + cluster or not. + :vartype enable_multiple_standard_load_balancers: bool + :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.v2024_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.v2024_02_02_preview.models.ClusterServiceLoadBalancerHealthProbeMode + """ + + _validation = { + "allocated_outbound_ports": {"maximum": 64000, "minimum": 0}, + "idle_timeout_in_minutes": {"maximum": 120, "minimum": 4}, + } + + _attribute_map = { + "managed_outbound_i_ps": { + "key": "managedOutboundIPs", + "type": "ManagedClusterLoadBalancerProfileManagedOutboundIPs", + }, + "outbound_ip_prefixes": { + "key": "outboundIPPrefixes", + "type": "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + }, + "outbound_i_ps": {"key": "outboundIPs", "type": "ManagedClusterLoadBalancerProfileOutboundIPs"}, + "effective_outbound_i_ps": {"key": "effectiveOutboundIPs", "type": "[ResourceReference]"}, + "allocated_outbound_ports": {"key": "allocatedOutboundPorts", "type": "int"}, + "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, + "enable_multiple_standard_load_balancers": {"key": "enableMultipleStandardLoadBalancers", "type": "bool"}, + "backend_pool_type": {"key": "backendPoolType", "type": "str"}, + "cluster_service_load_balancer_health_probe_mode": { + "key": "clusterServiceLoadBalancerHealthProbeMode", + "type": "str", + }, + } + + def __init__( + self, + *, + managed_outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileManagedOutboundIPs"] = None, + outbound_ip_prefixes: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes"] = None, + outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPs"] = None, + effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None, + allocated_outbound_ports: int = 0, + idle_timeout_in_minutes: int = 30, + enable_multiple_standard_load_balancers: Optional[bool] = None, + backend_pool_type: Union[str, "_models.BackendPoolType"] = "NodeIPConfiguration", + cluster_service_load_balancer_health_probe_mode: Union[ + str, "_models.ClusterServiceLoadBalancerHealthProbeMode" + ] = "ServiceNodePort", + **kwargs: Any + ) -> None: + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ResourceReference] + :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. + :paramtype allocated_outbound_ports: int + :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 30 minutes. + :paramtype idle_timeout_in_minutes: int + :keyword enable_multiple_standard_load_balancers: Enable multiple standard load balancers per + AKS cluster or not. + :paramtype enable_multiple_standard_load_balancers: bool + :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.v2024_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.v2024_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 = effective_outbound_i_ps + 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 + self.backend_pool_type = backend_pool_type + self.cluster_service_load_balancer_health_probe_mode = cluster_service_load_balancer_health_probe_mode + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(_serialization.Model): # pylint: disable=name-too-long + """Desired managed outbound IPs for the cluster load balancer. + + :ivar count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :vartype count: int + :ivar count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :vartype count_ipv6: int + """ + + _validation = { + "count": {"maximum": 100, "minimum": 1}, + "count_ipv6": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + "count_ipv6": {"key": "countIPv6", "type": "int"}, + } + + def __init__(self, *, count: int = 1, count_ipv6: int = 0, **kwargs: Any) -> None: + """ + :keyword count: The desired number of IPv4 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 1. + :paramtype count: int + :keyword count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :paramtype count_ipv6: int + """ + super().__init__(**kwargs) + self.count = count + self.count_ipv6 = count_ipv6 + + +class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(_serialization.Model): # pylint: disable=name-too-long + """Desired outbound IP Prefix resources for the cluster load balancer. + + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ResourceReference] + """ + + _attribute_map = { + "public_ip_prefixes": {"key": "publicIPPrefixes", "type": "[ResourceReference]"}, + } + + def __init__( + self, *, public_ip_prefixes: Optional[List["_models.ResourceReference"]] = None, **kwargs: Any + ) -> None: + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ResourceReference] + """ + super().__init__(**kwargs) + self.public_ip_prefixes = public_ip_prefixes + + +class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): # pylint: disable=name-too-long + """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.v2024_02_02_preview.models.ResourceReference] + """ + + _attribute_map = { + "public_i_ps": {"key": "publicIPs", "type": "[ResourceReference]"}, + } + + 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.v2024_02_02_preview.models.ResourceReference] + """ + super().__init__(**kwargs) + self.public_i_ps = public_i_ps + + +class ManagedClusterManagedOutboundIPProfile(_serialization.Model): + """Profile of the managed outbound IP resources of the managed cluster. + + :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must + be in the range of 1 to 16 (inclusive). The default value is 1. + :vartype count: int + """ + + _validation = { + "count": {"maximum": 16, "minimum": 1}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, count: int = 1, **kwargs: Any) -> None: + """ + :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values + must be in the range of 1 to 16 (inclusive). The default value is 1. + :paramtype count: int + """ + super().__init__(**kwargs) + self.count = count + + +class ManagedClusterMetricsProfile(_serialization.Model): + """The metrics profile for the ManagedCluster. + + :ivar cost_analysis: The cost analysis configuration for the cluster. + :vartype cost_analysis: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterCostAnalysis + """ + + _attribute_map = { + "cost_analysis": {"key": "costAnalysis", "type": "ManagedClusterCostAnalysis"}, + } + + def __init__(self, *, cost_analysis: Optional["_models.ManagedClusterCostAnalysis"] = None, **kwargs: Any) -> None: + """ + :keyword cost_analysis: The cost analysis configuration for the cluster. + :paramtype cost_analysis: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterCostAnalysis + """ + super().__init__(**kwargs) + self.cost_analysis = cost_analysis + + +class ManagedClusterNATGatewayProfile(_serialization.Model): + """Profile of the managed cluster NAT gateway. + + :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.v2024_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.v2024_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 + """ + + _validation = { + "idle_timeout_in_minutes": {"maximum": 120, "minimum": 4}, + } + + _attribute_map = { + "managed_outbound_ip_profile": { + "key": "managedOutboundIPProfile", + "type": "ManagedClusterManagedOutboundIPProfile", + }, + "effective_outbound_i_ps": {"key": "effectiveOutboundIPs", "type": "[ResourceReference]"}, + "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, + } + + def __init__( + self, + *, + managed_outbound_ip_profile: Optional["_models.ManagedClusterManagedOutboundIPProfile"] = None, + effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None, + idle_timeout_in_minutes: int = 4, + **kwargs: Any + ) -> None: + """ + :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.v2024_02_02_preview.models.ManagedClusterManagedOutboundIPProfile + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT + gateway. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ResourceReference] + :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 = effective_outbound_i_ps + self.idle_timeout_in_minutes = idle_timeout_in_minutes + + +class ManagedClusterNodeProvisioningProfile(_serialization.Model): + """ManagedClusterNodeProvisioningProfile. + + :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.v2024_02_02_preview.models.NodeProvisioningMode + """ + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + } + + def __init__(self, *, mode: Optional[Union[str, "_models.NodeProvisioningMode"]] = None, **kwargs: Any) -> None: + """ + :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.v2024_02_02_preview.models.NodeProvisioningMode + """ + super().__init__(**kwargs) + self.mode = mode + + +class ManagedClusterNodeResourceGroupProfile(_serialization.Model): + """Node resource group lockdown profile for a managed cluster. + + :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.v2024_02_02_preview.models.RestrictionLevel + """ + + _attribute_map = { + "restriction_level": {"key": "restrictionLevel", "type": "str"}, + } + + def __init__( + self, *, restriction_level: Optional[Union[str, "_models.RestrictionLevel"]] = None, **kwargs: Any + ) -> None: + """ + :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.v2024_02_02_preview.models.RestrictionLevel + """ + super().__init__(**kwargs) + self.restriction_level = restriction_level + + +class ManagedClusterOIDCIssuerProfile(_serialization.Model): + """The OIDC issuer profile of the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar issuer_url: The OIDC issuer url of the Managed Cluster. + :vartype issuer_url: str + :ivar enabled: Whether the OIDC issuer is enabled. + :vartype enabled: bool + """ + + _validation = { + "issuer_url": {"readonly": True}, + } + + _attribute_map = { + "issuer_url": {"key": "issuerURL", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether the OIDC issuer is enabled. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.issuer_url = None + self.enabled = enabled + + +class ManagedClusterPodIdentity(_serialization.Model): + """Details about the pod identity assigned to the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the pod identity. Required. + :vartype name: str + :ivar namespace: The namespace of the pod identity. Required. + :vartype namespace: str + :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.v2024_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.v2024_02_02_preview.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPodIdentityProvisioningInfo + """ + + _validation = { + "name": {"required": True}, + "namespace": {"required": True}, + "identity": {"required": True}, + "provisioning_state": {"readonly": True}, + "provisioning_info": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "binding_selector": {"key": "bindingSelector", "type": "str"}, + "identity": {"key": "identity", "type": "UserAssignedIdentity"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "provisioning_info": {"key": "provisioningInfo", "type": "ManagedClusterPodIdentityProvisioningInfo"}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + identity: "_models.UserAssignedIdentity", + binding_selector: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the pod identity. Required. + :paramtype name: str + :keyword namespace: The namespace of the pod identity. Required. + :paramtype namespace: str + :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.v2024_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 + + +class ManagedClusterPodIdentityException(_serialization.Model): + """See `disable AAD Pod Identity for a specific Pod/Application + `_ for more + details. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the pod identity exception. Required. + :vartype name: str + :ivar namespace: The namespace of the pod identity exception. Required. + :vartype namespace: str + :ivar pod_labels: The pod labels to match. Required. + :vartype pod_labels: dict[str, str] + """ + + _validation = { + "name": {"required": True}, + "namespace": {"required": True}, + "pod_labels": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "pod_labels": {"key": "podLabels", "type": "{str}"}, + } + + def __init__(self, *, name: str, namespace: str, pod_labels: Dict[str, str], **kwargs: Any) -> None: + """ + :keyword name: The name of the pod identity exception. Required. + :paramtype name: str + :keyword namespace: The namespace of the pod identity exception. Required. + :paramtype namespace: str + :keyword pod_labels: The pod labels to match. Required. + :paramtype pod_labels: dict[str, str] + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.pod_labels = pod_labels + + +class ManagedClusterPodIdentityProfile(_serialization.Model): + """See `use AAD pod identity `_ + for more details on pod identity integration. + + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :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.v2024_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.v2024_02_02_preview.models.ManagedClusterPodIdentityException] + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "allow_network_plugin_kubenet": {"key": "allowNetworkPluginKubenet", "type": "bool"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "[ManagedClusterPodIdentity]"}, + "user_assigned_identity_exceptions": { + "key": "userAssignedIdentityExceptions", + "type": "[ManagedClusterPodIdentityException]", + }, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + allow_network_plugin_kubenet: Optional[bool] = None, + user_assigned_identities: Optional[List["_models.ManagedClusterPodIdentity"]] = None, + user_assigned_identity_exceptions: Optional[List["_models.ManagedClusterPodIdentityException"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :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.v2024_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.v2024_02_02_preview.models.ManagedClusterPodIdentityException] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.allow_network_plugin_kubenet = allow_network_plugin_kubenet + self.user_assigned_identities = user_assigned_identities + self.user_assigned_identity_exceptions = user_assigned_identity_exceptions + + +class ManagedClusterPodIdentityProvisioningError(_serialization.Model): # pylint: disable=name-too-long + """An error response from the pod identity provisioning. + + :ivar error: Details about the error. + :vartype error: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningErrorBody"}, + } + + def __init__( + self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs: Any + ) -> None: + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + super().__init__(**kwargs) + self.error = error + + +class ManagedClusterPodIdentityProvisioningErrorBody(_serialization.Model): # pylint: disable=name-too-long + """An error response from the pod identity provisioning. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ManagedClusterPodIdentityProvisioningErrorBody]"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.ManagedClusterPodIdentityProvisioningErrorBody"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ManagedClusterPodIdentityProvisioningInfo(_serialization.Model): # pylint: disable=name-too-long + """ManagedClusterPodIdentityProvisioningInfo. + + :ivar error: Pod identity assignment error (if any). + :vartype error: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningError"}, + } + + def __init__( + self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = None, **kwargs: Any + ) -> None: + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPodIdentityProvisioningError + """ + super().__init__(**kwargs) + self.error = error + + +class ManagedClusterPoolUpgradeProfile(_serialization.Model): + """The list of available upgrade versions. + + All required parameters must be populated in order to send to server. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :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.v2024_02_02_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + + _validation = { + "kubernetes_version": {"required": True}, + "os_type": {"required": True}, + } + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "os_type": {"key": "osType", "type": "str"}, + "upgrades": {"key": "upgrades", "type": "[ManagedClusterPoolUpgradeProfileUpgradesItem]"}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "_models.OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["_models.ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :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.v2024_02_02_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.name = name + self.os_type = os_type + self.upgrades = upgrades + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(_serialization.Model): # pylint: disable=name-too-long + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, *, kubernetes_version: Optional[str] = None, is_preview: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class ManagedClusterPropertiesAutoScalerProfile( + _serialization.Model +): # pylint: disable=too-many-instance-attributes,name-too-long + """Parameters to be applied to the cluster-autoscaler when enabled. + + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar daemonset_eviction_for_empty_nodes: If set to true, all daemonset pods on empty nodes + will be evicted before deletion of the node. If the daemonset pod cannot be evicted another + node will be chosen for scaling. If set to false, the node will be deleted without ensuring + that daemonset pods are deleted or evicted. + :vartype daemonset_eviction_for_empty_nodes: bool + :ivar daemonset_eviction_for_occupied_nodes: If set to true, all daemonset pods on occupied + nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted + another node will be chosen for scaling. If set to false, the node will be deleted without + ensuring that daemonset pods are deleted or evicted. + :vartype daemonset_eviction_for_occupied_nodes: bool + :ivar ignore_daemonsets_utilization: If set to true, the resources used by daemonset will be + taken into account when making scaling down decisions. + :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.v2024_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. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str + """ + + _attribute_map = { + "balance_similar_node_groups": {"key": "balance-similar-node-groups", "type": "str"}, + "daemonset_eviction_for_empty_nodes": {"key": "daemonset-eviction-for-empty-nodes", "type": "bool"}, + "daemonset_eviction_for_occupied_nodes": {"key": "daemonset-eviction-for-occupied-nodes", "type": "bool"}, + "ignore_daemonsets_utilization": {"key": "ignore-daemonsets-utilization", "type": "bool"}, + "expander": {"key": "expander", "type": "str"}, + "max_empty_bulk_delete": {"key": "max-empty-bulk-delete", "type": "str"}, + "max_graceful_termination_sec": {"key": "max-graceful-termination-sec", "type": "str"}, + "max_node_provision_time": {"key": "max-node-provision-time", "type": "str"}, + "max_total_unready_percentage": {"key": "max-total-unready-percentage", "type": "str"}, + "new_pod_scale_up_delay": {"key": "new-pod-scale-up-delay", "type": "str"}, + "ok_total_unready_count": {"key": "ok-total-unready-count", "type": "str"}, + "scan_interval": {"key": "scan-interval", "type": "str"}, + "scale_down_delay_after_add": {"key": "scale-down-delay-after-add", "type": "str"}, + "scale_down_delay_after_delete": {"key": "scale-down-delay-after-delete", "type": "str"}, + "scale_down_delay_after_failure": {"key": "scale-down-delay-after-failure", "type": "str"}, + "scale_down_unneeded_time": {"key": "scale-down-unneeded-time", "type": "str"}, + "scale_down_unready_time": {"key": "scale-down-unready-time", "type": "str"}, + "scale_down_utilization_threshold": {"key": "scale-down-utilization-threshold", "type": "str"}, + "skip_nodes_with_local_storage": {"key": "skip-nodes-with-local-storage", "type": "str"}, + "skip_nodes_with_system_pods": {"key": "skip-nodes-with-system-pods", "type": "str"}, + } + + def __init__( + self, + *, + balance_similar_node_groups: Optional[str] = None, + daemonset_eviction_for_empty_nodes: Optional[bool] = None, + daemonset_eviction_for_occupied_nodes: Optional[bool] = None, + ignore_daemonsets_utilization: Optional[bool] = None, + expander: Optional[Union[str, "_models.Expander"]] = None, + max_empty_bulk_delete: Optional[str] = None, + max_graceful_termination_sec: Optional[str] = None, + max_node_provision_time: Optional[str] = None, + max_total_unready_percentage: Optional[str] = None, + new_pod_scale_up_delay: Optional[str] = None, + ok_total_unready_count: Optional[str] = None, + scan_interval: Optional[str] = None, + scale_down_delay_after_add: Optional[str] = None, + scale_down_delay_after_delete: Optional[str] = None, + scale_down_delay_after_failure: Optional[str] = None, + scale_down_unneeded_time: Optional[str] = None, + scale_down_unready_time: Optional[str] = None, + scale_down_utilization_threshold: Optional[str] = None, + skip_nodes_with_local_storage: Optional[str] = None, + skip_nodes_with_system_pods: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword daemonset_eviction_for_empty_nodes: If set to true, all daemonset pods on empty nodes + will be evicted before deletion of the node. If the daemonset pod cannot be evicted another + node will be chosen for scaling. If set to false, the node will be deleted without ensuring + that daemonset pods are deleted or evicted. + :paramtype daemonset_eviction_for_empty_nodes: bool + :keyword daemonset_eviction_for_occupied_nodes: If set to true, all daemonset pods on occupied + nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted + another node will be chosen for scaling. If set to false, the node will be deleted without + ensuring that daemonset pods are deleted or evicted. + :paramtype daemonset_eviction_for_occupied_nodes: bool + :keyword ignore_daemonsets_utilization: If set to true, the resources used by daemonset will be + taken into account when making scaling down decisions. + :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.v2024_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. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ + super().__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + self.daemonset_eviction_for_empty_nodes = daemonset_eviction_for_empty_nodes + self.daemonset_eviction_for_occupied_nodes = daemonset_eviction_for_occupied_nodes + self.ignore_daemonsets_utilization = ignore_daemonsets_utilization + self.expander = expander + self.max_empty_bulk_delete = max_empty_bulk_delete + self.max_graceful_termination_sec = max_graceful_termination_sec + self.max_node_provision_time = max_node_provision_time + self.max_total_unready_percentage = max_total_unready_percentage + self.new_pod_scale_up_delay = new_pod_scale_up_delay + self.ok_total_unready_count = ok_total_unready_count + self.scan_interval = scan_interval + self.scale_down_delay_after_add = scale_down_delay_after_add + self.scale_down_delay_after_delete = scale_down_delay_after_delete + self.scale_down_delay_after_failure = scale_down_delay_after_failure + self.scale_down_unneeded_time = scale_down_unneeded_time + self.scale_down_unready_time = scale_down_unready_time + self.scale_down_utilization_threshold = scale_down_utilization_threshold + self.skip_nodes_with_local_storage = skip_nodes_with_local_storage + self.skip_nodes_with_system_pods = skip_nodes_with_system_pods + + +class ManagedClusterPropertiesForSnapshot(_serialization.Model): + """managed cluster properties for snapshot, these properties are read only. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kubernetes_version: The current kubernetes version. + :vartype kubernetes_version: str + :ivar sku: The current managed cluster sku. + :vartype sku: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.NetworkProfileForSnapshot + """ + + _validation = { + "network_profile": {"readonly": True}, + } + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "sku": {"key": "sku", "type": "ManagedClusterSKU"}, + "enable_rbac": {"key": "enableRbac", "type": "bool"}, + "network_profile": {"key": "networkProfile", "type": "NetworkProfileForSnapshot"}, + } + + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + sku: Optional["_models.ManagedClusterSKU"] = None, + enable_rbac: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The current kubernetes version. + :paramtype kubernetes_version: str + :keyword sku: The current managed cluster sku. + :paramtype sku: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSKU + :keyword enable_rbac: Whether the cluster has enabled Kubernetes Role-Based Access Control or + not. + :paramtype enable_rbac: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.sku = sku + self.enable_rbac = enable_rbac + self.network_profile = None + + +class ManagedClusterSecurityProfile(_serialization.Model): + """Security profile for the container service cluster. + + :ivar defender: Microsoft Defender settings for the security profile. + :vartype defender: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + :ivar image_cleaner: Image Cleaner settings for the security profile. + :vartype image_cleaner: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterSecurityProfileImageIntegrity + :ivar node_restriction: `Node Restriction + `_ + settings for the security profile. + :vartype node_restriction: + ~azure.mgmt.containerservice.v2024_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 nodes with the Custom CA Trust feature enabled. For more information see + `Custom CA Trust Certificates + `_. + :vartype custom_ca_trust_certificates: list[bytes] + """ + + _validation = { + "custom_ca_trust_certificates": {"max_items": 10, "min_items": 0}, + } + + _attribute_map = { + "defender": {"key": "defender", "type": "ManagedClusterSecurityProfileDefender"}, + "azure_key_vault_kms": {"key": "azureKeyVaultKms", "type": "AzureKeyVaultKms"}, + "workload_identity": {"key": "workloadIdentity", "type": "ManagedClusterSecurityProfileWorkloadIdentity"}, + "image_cleaner": {"key": "imageCleaner", "type": "ManagedClusterSecurityProfileImageCleaner"}, + "image_integrity": {"key": "imageIntegrity", "type": "ManagedClusterSecurityProfileImageIntegrity"}, + "node_restriction": {"key": "nodeRestriction", "type": "ManagedClusterSecurityProfileNodeRestriction"}, + "custom_ca_trust_certificates": {"key": "customCATrustCertificates", "type": "[bytearray]"}, + } + + def __init__( + self, + *, + defender: Optional["_models.ManagedClusterSecurityProfileDefender"] = None, + azure_key_vault_kms: Optional["_models.AzureKeyVaultKms"] = None, + workload_identity: Optional["_models.ManagedClusterSecurityProfileWorkloadIdentity"] = None, + image_cleaner: Optional["_models.ManagedClusterSecurityProfileImageCleaner"] = None, + image_integrity: Optional["_models.ManagedClusterSecurityProfileImageIntegrity"] = None, + node_restriction: Optional["_models.ManagedClusterSecurityProfileNodeRestriction"] = None, + custom_ca_trust_certificates: Optional[List[bytes]] = None, + **kwargs: Any + ) -> None: + """ + :keyword defender: Microsoft Defender settings for the security profile. + :paramtype defender: + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + :keyword image_cleaner: Image Cleaner settings for the security profile. + :paramtype image_cleaner: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterSecurityProfileImageIntegrity + :keyword node_restriction: `Node Restriction + `_ + settings for the security profile. + :paramtype node_restriction: + ~azure.mgmt.containerservice.v2024_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 nodes with the Custom CA Trust feature enabled. For more information see + `Custom CA Trust Certificates + `_. + :paramtype custom_ca_trust_certificates: list[bytes] + """ + super().__init__(**kwargs) + self.defender = defender + self.azure_key_vault_kms = azure_key_vault_kms + self.workload_identity = workload_identity + self.image_cleaner = image_cleaner + self.image_integrity = image_integrity + self.node_restriction = node_restriction + self.custom_ca_trust_certificates = custom_ca_trust_certificates + + +class ManagedClusterSecurityProfileDefender(_serialization.Model): + """Microsoft Defender settings for the security profile. + + :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required + and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + empty. + :vartype log_analytics_workspace_resource_id: str + :ivar security_monitoring: Microsoft Defender threat detection for Cloud settings for the + security profile. + :vartype security_monitoring: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + """ + + _attribute_map = { + "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, + "security_monitoring": { + "key": "securityMonitoring", + "type": "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + }, + } + + def __init__( + self, + *, + log_analytics_workspace_resource_id: Optional[str] = None, + security_monitoring: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityMonitoring"] = None, + **kwargs: Any + ) -> None: + """ + :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required + and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + empty. + :paramtype log_analytics_workspace_resource_id: str + :keyword security_monitoring: Microsoft Defender threat detection for Cloud settings for the + security profile. + :paramtype security_monitoring: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + """ + super().__init__(**kwargs) + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + self.security_monitoring = security_monitoring + + +class ManagedClusterSecurityProfileDefenderSecurityMonitoring(_serialization.Model): # pylint: disable=name-too-long + """Microsoft Defender settings for the security profile threat detection. + + :ivar enabled: Whether to enable Defender threat detection. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Defender threat detection. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileImageCleaner(_serialization.Model): # pylint: disable=name-too-long + """Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce + attack surface area. Here are settings for the security profile. + + :ivar enabled: Whether to enable Image Cleaner on AKS cluster. + :vartype enabled: bool + :ivar interval_hours: Image Cleaner scanning interval in hours. + :vartype interval_hours: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "interval_hours": {"key": "intervalHours", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, interval_hours: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Image Cleaner on AKS cluster. + :paramtype enabled: bool + :keyword interval_hours: Image Cleaner scanning interval in hours. + :paramtype interval_hours: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.interval_hours = interval_hours + + +class ManagedClusterSecurityProfileImageIntegrity(_serialization.Model): # pylint: disable=name-too-long + """Image integrity related settings for the security profile. + + :ivar enabled: Whether to enable image integrity. The default value is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable image integrity. The default value is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileNodeRestriction(_serialization.Model): # pylint: disable=name-too-long + """Node Restriction settings for the security profile. + + :ivar enabled: Whether to enable Node Restriction. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Node Restriction. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileWorkloadIdentity(_serialization.Model): # pylint: disable=name-too-long + """Workload identity settings for the security profile. + + :ivar enabled: Whether to enable workload identity. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable workload identity. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterServicePrincipalProfile(_serialization.Model): + """Information about a service principal identity for the cluster to use for manipulating Azure + APIs. + + All required parameters must be populated in order to send to server. + + :ivar client_id: The ID for the service principal. Required. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str + """ + + _validation = { + "client_id": {"required": True}, + } + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + "secret": {"key": "secret", "type": "str"}, + } + + def __init__(self, *, client_id: str, secret: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword client_id: The ID for the service principal. Required. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ + super().__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +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.v2024_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.v2024_02_02_preview.models.ManagedClusterSKUTier + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "_models.ManagedClusterSKUTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of a managed cluster SKU. "Base" + :paramtype name: str or + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterSKUTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + +class ManagedClusterSnapshot(TrackedResource): + """A managed cluster snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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.v2024_02_02_preview.models.ManagedClusterPropertiesForSnapshot + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "managed_cluster_properties_read_only": {"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}"}, + "location": {"key": "location", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "snapshot_type": {"key": "properties.snapshotType", "type": "str"}, + "managed_cluster_properties_read_only": { + "key": "properties.managedClusterPropertiesReadOnly", + "type": "ManagedClusterPropertiesForSnapshot", + }, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["_models.CreationData"] = None, + snapshot_type: Union[str, "_models.SnapshotType"] = "NodePool", + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :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.v2024_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.v2024_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 + + +class ManagedClusterSnapshotListResult(_serialization.Model): + """The response from the List Managed Cluster Snapshots operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of managed cluster snapshots. + :vartype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot] + :ivar next_link: The URL to get the next set of managed cluster snapshot results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ManagedClusterSnapshot]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ManagedClusterSnapshot"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of managed cluster snapshots. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterStaticEgressGatewayProfile(_serialization.Model): + """The Static Egress Gateway addon configuration for the cluster. + + :ivar enabled: Indicates if Static Egress Gateway addon is enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Static Egress Gateway addon is enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfile(_serialization.Model): + """Storage profile for the container service cluster. + + :ivar disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. + :vartype disk_csi_driver: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + :ivar file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :vartype file_csi_driver: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + :ivar snapshot_controller: Snapshot Controller settings for the storage profile. + :vartype snapshot_controller: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfileSnapshotController + :ivar blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :vartype blob_csi_driver: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver + """ + + _attribute_map = { + "disk_csi_driver": {"key": "diskCSIDriver", "type": "ManagedClusterStorageProfileDiskCSIDriver"}, + "file_csi_driver": {"key": "fileCSIDriver", "type": "ManagedClusterStorageProfileFileCSIDriver"}, + "snapshot_controller": {"key": "snapshotController", "type": "ManagedClusterStorageProfileSnapshotController"}, + "blob_csi_driver": {"key": "blobCSIDriver", "type": "ManagedClusterStorageProfileBlobCSIDriver"}, + } + + def __init__( + self, + *, + disk_csi_driver: Optional["_models.ManagedClusterStorageProfileDiskCSIDriver"] = None, + file_csi_driver: Optional["_models.ManagedClusterStorageProfileFileCSIDriver"] = None, + snapshot_controller: Optional["_models.ManagedClusterStorageProfileSnapshotController"] = None, + blob_csi_driver: Optional["_models.ManagedClusterStorageProfileBlobCSIDriver"] = None, + **kwargs: Any + ) -> None: + """ + :keyword disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. + :paramtype disk_csi_driver: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + :keyword file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :paramtype file_csi_driver: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + :keyword snapshot_controller: Snapshot Controller settings for the storage profile. + :paramtype snapshot_controller: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfileSnapshotController + :keyword blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :paramtype blob_csi_driver: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver + """ + super().__init__(**kwargs) + self.disk_csi_driver = disk_csi_driver + self.file_csi_driver = file_csi_driver + self.snapshot_controller = snapshot_controller + self.blob_csi_driver = blob_csi_driver + + +class ManagedClusterStorageProfileBlobCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureBlob CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureBlob CSI Driver. The default value is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureBlob CSI Driver. The default value is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfileDiskCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureDisk CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureDisk CSI Driver. The default value is true. + :vartype enabled: bool + :ivar version: The version of AzureDisk CSI Driver. The default value is v1. + :vartype version: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, version: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureDisk CSI Driver. The default value is true. + :paramtype enabled: bool + :keyword version: The version of AzureDisk CSI Driver. The default value is v1. + :paramtype version: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.version = version + + +class ManagedClusterStorageProfileFileCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureFile CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureFile CSI Driver. The default value is true. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureFile CSI Driver. The default value is true. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfileSnapshotController(_serialization.Model): # pylint: disable=name-too-long + """Snapshot Controller settings for the storage profile. + + :ivar enabled: Whether to enable Snapshot Controller. The default value is true. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Snapshot Controller. The default value is true. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterUpgradeProfile(_serialization.Model): + """The list of available upgrades for compute pools. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the upgrade profile. + :vartype id: str + :ivar name: The name of the upgrade profile. + :vartype name: str + :ivar type: The type of the upgrade profile. + :vartype type: str + :ivar control_plane_profile: The list of available upgrade versions for the control plane. + Required. + :vartype control_plane_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterPoolUpgradeProfile] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "control_plane_profile": {"required": True}, + "agent_pool_profiles": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "control_plane_profile": {"key": "properties.controlPlaneProfile", "type": "ManagedClusterPoolUpgradeProfile"}, + "agent_pool_profiles": {"key": "properties.agentPoolProfiles", "type": "[ManagedClusterPoolUpgradeProfile]"}, + } + + def __init__( + self, + *, + control_plane_profile: "_models.ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["_models.ManagedClusterPoolUpgradeProfile"], + **kwargs: Any + ) -> None: + """ + :keyword control_plane_profile: The list of available upgrade versions for the control plane. + Required. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterPoolUpgradeProfile] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.control_plane_profile = control_plane_profile + self.agent_pool_profiles = agent_pool_profiles + + +class ManagedClusterWindowsProfile(_serialization.Model): + """Profile for Windows VMs in the managed cluster. + + All required parameters must be populated in order to send to server. + + :ivar admin_username: Specifies the name of the administrator account. :code:`
`:code:`
` + **Restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** + "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", + "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character + :code:`
`:code:`
` **Max-length:** 20 characters. Required. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :vartype admin_password: str + :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.v2024_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.v2024_02_02_preview.models.WindowsGmsaProfile + """ + + _validation = { + "admin_username": {"required": True}, + } + + _attribute_map = { + "admin_username": {"key": "adminUsername", "type": "str"}, + "admin_password": {"key": "adminPassword", "type": "str"}, + "license_type": {"key": "licenseType", "type": "str"}, + "enable_csi_proxy": {"key": "enableCSIProxy", "type": "bool"}, + "gmsa_profile": {"key": "gmsaProfile", "type": "WindowsGmsaProfile"}, + } + + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + license_type: Optional[Union[str, "_models.LicenseType"]] = None, + enable_csi_proxy: Optional[bool] = None, + gmsa_profile: Optional["_models.WindowsGmsaProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword admin_username: Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. Required. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :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.v2024_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.v2024_02_02_preview.models.WindowsGmsaProfile + """ + super().__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + self.license_type = license_type + self.enable_csi_proxy = enable_csi_proxy + self.gmsa_profile = gmsa_profile + + +class ManagedClusterWorkloadAutoScalerProfile(_serialization.Model): + """Workload Auto-scaler profile for the managed cluster. + + :ivar keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :vartype keda: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + :ivar vertical_pod_autoscaler: + :vartype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler # pylint: disable=line-too-long + """ + + _attribute_map = { + "keda": {"key": "keda", "type": "ManagedClusterWorkloadAutoScalerProfileKeda"}, + "vertical_pod_autoscaler": { + "key": "verticalPodAutoscaler", + "type": "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + }, + } + + def __init__( + self, + *, + keda: Optional["_models.ManagedClusterWorkloadAutoScalerProfileKeda"] = None, + vertical_pod_autoscaler: Optional[ + "_models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler" + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :paramtype keda: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + :keyword vertical_pod_autoscaler: + :paramtype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.keda = keda + self.vertical_pod_autoscaler = vertical_pod_autoscaler + + +class ManagedClusterWorkloadAutoScalerProfileKeda(_serialization.Model): # pylint: disable=name-too-long + """KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable KEDA. Required. + :vartype enabled: bool + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: bool, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable KEDA. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler( + _serialization.Model +): # pylint: disable=name-too-long + """ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable VPA add-on in cluster. Default value is false. Required. + :vartype enabled: bool + :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.v2024_02_02_preview.models.AddonAutoscaling + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "addon_autoscaling": {"key": "addonAutoscaling", "type": "str"}, + } + + def __init__( + self, + *, + enabled: bool = False, + addon_autoscaling: Union[str, "_models.AddonAutoscaling"] = "Disabled", + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable VPA add-on in cluster. Default value is false. Required. + :paramtype enabled: bool + :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.v2024_02_02_preview.models.AddonAutoscaling + """ + super().__init__(**kwargs) + self.enabled = enabled + self.addon_autoscaling = addon_autoscaling + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(_serialization.Model): # pylint: disable=name-too-long + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ManualScaleProfile(_serialization.Model): + """Specifications on number of machines. + + :ivar sizes: The list of allowed vm sizes. 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 count: Number of nodes. + :vartype count: int + """ + + _validation = { + "count": {"maximum": 1000, "minimum": 0}, + } + + _attribute_map = { + "sizes": {"key": "sizes", "type": "[str]"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, sizes: Optional[List[str]] = None, count: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword sizes: The list of allowed vm sizes. 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 count: Number of nodes. + :paramtype count: int + """ + super().__init__(**kwargs) + self.sizes = sizes + self.count = count + + +class MeshRevision(_serialization.Model): + """Holds information on upgrades and compatibility for given major.minor mesh release. + + :ivar revision: The revision of the mesh release. + :vartype revision: str + :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. + :vartype upgrades: list[str] + :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.v2024_02_02_preview.models.CompatibleVersions] + """ + + _attribute_map = { + "revision": {"key": "revision", "type": "str"}, + "upgrades": {"key": "upgrades", "type": "[str]"}, + "compatible_with": {"key": "compatibleWith", "type": "[CompatibleVersions]"}, + } + + def __init__( + self, + *, + revision: Optional[str] = None, + upgrades: Optional[List[str]] = None, + compatible_with: Optional[List["_models.CompatibleVersions"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword revision: The revision of the mesh release. + :paramtype revision: str + :keyword upgrades: List of revisions available for upgrade of a specific mesh revision. + :paramtype upgrades: list[str] + :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.v2024_02_02_preview.models.CompatibleVersions] + """ + super().__init__(**kwargs) + self.revision = revision + self.upgrades = upgrades + self.compatible_with = compatible_with + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_02_02_preview.models.SystemData + """ + + +class MeshRevisionProfile(ProxyResource): + """Mesh revision profile for a mesh. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_02_02_preview.models.SystemData + :ivar properties: Mesh revision profile properties for a mesh. + :vartype properties: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshRevisionProfileProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "properties": {"key": "properties", "type": "MeshRevisionProfileProperties"}, + } + + def __init__(self, *, properties: Optional["_models.MeshRevisionProfileProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Mesh revision profile properties for a mesh. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshRevisionProfileProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class MeshRevisionProfileList(_serialization.Model): + """Holds an array of MeshRevisionsProfiles. + + 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.v2024_02_02_preview.models.MeshRevisionProfile] + :ivar next_link: The URL to get the next set of mesh revision profile. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MeshRevisionProfile]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_02_02_preview.models.MeshRevisionProfile] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MeshRevisionProfileProperties(_serialization.Model): + """Mesh revision profile properties for a mesh. + + :ivar mesh_revisions: + :vartype mesh_revisions: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshRevision] + """ + + _attribute_map = { + "mesh_revisions": {"key": "meshRevisions", "type": "[MeshRevision]"}, + } + + def __init__(self, *, mesh_revisions: Optional[List["_models.MeshRevision"]] = None, **kwargs: Any) -> None: + """ + :keyword mesh_revisions: + :paramtype mesh_revisions: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshRevision] + """ + super().__init__(**kwargs) + self.mesh_revisions = mesh_revisions + + +class MeshUpgradeProfile(ProxyResource): + """Upgrade profile for given mesh. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_02_02_preview.models.SystemData + :ivar properties: Mesh upgrade profile properties for a major.minor release. + :vartype properties: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshUpgradeProfileProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "properties": {"key": "properties", "type": "MeshUpgradeProfileProperties"}, + } + + def __init__(self, *, properties: Optional["_models.MeshUpgradeProfileProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Mesh upgrade profile properties for a major.minor release. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshUpgradeProfileProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class MeshUpgradeProfileList(_serialization.Model): + """Holds an array of MeshUpgradeProfiles. + + 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.v2024_02_02_preview.models.MeshUpgradeProfile] + :ivar next_link: The URL to get the next set of mesh upgrade profile. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MeshUpgradeProfile]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_02_02_preview.models.MeshUpgradeProfile] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MeshUpgradeProfileProperties(MeshRevision): + """Mesh upgrade profile properties for a major.minor release. + + :ivar revision: The revision of the mesh release. + :vartype revision: str + :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. + :vartype upgrades: list[str] + :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.v2024_02_02_preview.models.CompatibleVersions] + """ + + +class NetworkMonitoring(_serialization.Model): + """This addon can be used to configure network monitoring and generate network monitoring data in + Prometheus format. + + :ivar enabled: Enable or disable the network monitoring plugin on the cluster. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Enable or disable the network monitoring plugin on the cluster. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +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.v2024_02_02_preview.models.NetworkPlugin + :ivar network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" + :vartype network_plugin_mode: str or + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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.v2024_02_02_preview.models.LoadBalancerSku + """ + + _attribute_map = { + "network_plugin": {"key": "networkPlugin", "type": "str"}, + "network_plugin_mode": {"key": "networkPluginMode", "type": "str"}, + "network_policy": {"key": "networkPolicy", "type": "str"}, + "network_mode": {"key": "networkMode", "type": "str"}, + "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, + } + + def __init__( + self, + *, + network_plugin: Union[str, "_models.NetworkPlugin"] = "kubenet", + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_plugin: networkPlugin for managed cluster snapshot. Known values are: "azure", + "kubenet", and "none". + :paramtype network_plugin: str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.NetworkPlugin + :keyword network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" + :paramtype network_plugin_mode: str or + ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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.v2024_02_02_preview.models.LoadBalancerSku + """ + super().__init__(**kwargs) + self.network_plugin = network_plugin + self.network_plugin_mode = network_plugin_mode + self.network_policy = network_policy + self.network_mode = network_mode + self.load_balancer_sku = load_balancer_sku + + +class OperationListResult(_serialization.Model): + """The List Operation response. + + 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.v2024_02_02_preview.models.OperationValue] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OperationValue]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class OperationStatusResult(_serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ErrorDetail + """ + + _validation = { + "resource_id": {"readonly": True}, + "status": {"required": True}, + "percent_complete": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "percent_complete": {"key": "percentComplete", "type": "float"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "operations": {"key": "operations", "type": "[OperationStatusResult]"}, + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[List["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Operation status. Required. + :paramtype status: str + :keyword percent_complete: Percent of the operation that is complete. + :paramtype percent_complete: float + :keyword start_time: The start time of the operation. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the operation. + :paramtype end_time: ~datetime.datetime + :keyword operations: The operations list. + :paramtype operations: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.OperationStatusResult] + :keyword error: If present, details of the operation error. + :paramtype error: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ErrorDetail + """ + super().__init__(**kwargs) + self.id = id + self.resource_id = None + self.name = name + self.status = status + self.percent_complete = percent_complete + self.start_time = start_time + self.end_time = end_time + self.operations = operations + self.error = error + + +class OperationStatusResultList(_serialization.Model): + """The operations list. It contains an URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations. + :vartype value: + list[~azure.mgmt.containerservice.v2024_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 + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OperationStatusResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationValue(_serialization.Model): + """Describes the properties of a Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + "origin": {"readonly": True}, + "name": {"readonly": True}, + "operation": {"readonly": True}, + "resource": {"readonly": True}, + "description": {"readonly": True}, + "provider": {"readonly": True}, + } + + _attribute_map = { + "origin": {"key": "origin", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "operation": {"key": "display.operation", "type": "str"}, + "resource": {"key": "display.resource", "type": "str"}, + "description": {"key": "display.description", "type": "str"}, + "provider": {"key": "display.provider", "type": "str"}, + } + + 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 + + +class OSOptionProfile(_serialization.Model): + """The OS option profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the OS option resource. + :vartype id: str + :ivar name: The name of the OS option resource. + :vartype name: str + :ivar type: The type of the OS option resource. + :vartype type: str + :ivar os_option_property_list: The list of OS options. Required. + :vartype os_option_property_list: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.OSOptionProperty] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "os_option_property_list": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "os_option_property_list": {"key": "properties.osOptionPropertyList", "type": "[OSOptionProperty]"}, + } + + def __init__(self, *, os_option_property_list: List["_models.OSOptionProperty"], **kwargs: Any) -> None: + """ + :keyword os_option_property_list: The list of OS options. Required. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.OSOptionProperty] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.os_option_property_list = os_option_property_list + + +class OSOptionProperty(_serialization.Model): + """OS option property. + + All required parameters must be populated in order to send to server. + + :ivar os_type: The OS type. Required. + :vartype os_type: str + :ivar enable_fips_image: Whether the image is FIPS-enabled. Required. + :vartype enable_fips_image: bool + """ + + _validation = { + "os_type": {"required": True}, + "enable_fips_image": {"required": True}, + } + + _attribute_map = { + "os_type": {"key": "os-type", "type": "str"}, + "enable_fips_image": {"key": "enable-fips-image", "type": "bool"}, + } + + def __init__(self, *, os_type: str, enable_fips_image: bool, **kwargs: Any) -> None: + """ + :keyword os_type: The OS type. Required. + :paramtype os_type: str + :keyword enable_fips_image: Whether the image is FIPS-enabled. Required. + :paramtype enable_fips_image: bool + """ + super().__init__(**kwargs) + self.os_type = os_type + self.enable_fips_image = enable_fips_image + + +class OutboundEnvironmentEndpoint(_serialization.Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.EndpointDependency] + """ + + _attribute_map = { + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[EndpointDependency]"}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["_models.EndpointDependency"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.EndpointDependency] + """ + super().__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(_serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OutboundEnvironmentEndpoint]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.OutboundEnvironmentEndpoint"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.OutboundEnvironmentEndpoint] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class PortRange(_serialization.Model): + """The port range. + + :ivar port_start: The minimum port that is included in the range. It should be ranged from 1 to + 65535, and be less than or equal to portEnd. + :vartype port_start: int + :ivar port_end: The maximum port that is included in the range. It should be ranged from 1 to + 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.v2024_02_02_preview.models.Protocol + """ + + _validation = { + "port_start": {"maximum": 65535, "minimum": 1}, + "port_end": {"maximum": 65535, "minimum": 1}, + } + + _attribute_map = { + "port_start": {"key": "portStart", "type": "int"}, + "port_end": {"key": "portEnd", "type": "int"}, + "protocol": {"key": "protocol", "type": "str"}, + } + + def __init__( + self, + *, + port_start: Optional[int] = None, + port_end: Optional[int] = None, + protocol: Optional[Union[str, "_models.Protocol"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword port_start: The minimum port that is included in the range. It should be ranged from 1 + to 65535, and be less than or equal to portEnd. + :paramtype port_start: int + :keyword port_end: The maximum port that is included in the range. It should be ranged from 1 + 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.v2024_02_02_preview.models.Protocol + """ + super().__init__(**kwargs) + self.port_start = port_start + self.port_end = port_end + self.protocol = protocol + + +class PowerState(_serialization.Model): + """Describes the Power State of the cluster. + + :ivar code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and + "Stopped". + :vartype code: str or ~azure.mgmt.containerservice.v2024_02_02_preview.models.Code + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + } + + def __init__(self, *, code: Optional[Union[str, "_models.Code"]] = None, **kwargs: Any) -> None: + """ + :keyword code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and + "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2024_02_02_preview.models.Code + """ + super().__init__(**kwargs) + self.code = code + + +class PrivateEndpoint(_serialization.Model): + """Private endpoint which a connection belongs to. + + :ivar id: The resource ID of the private endpoint. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(_serialization.Model): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private endpoint connection. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar provisioning_state: The current provisioning state. Known values are: "Canceled", + "Creating", "Deleting", "Failed", and "Succeeded". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnectionProvisioningState + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.PrivateLinkServiceConnectionState + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + } + + def __init__( + self, + *, + private_endpoint: Optional["_models.PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, + **kwargs: Any + ) -> None: + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.PrivateLinkServiceConnectionState + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionListResult(_serialization.Model): + """A list of private endpoint connections. + + :ivar value: The collection value. + :vartype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnection] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnection] + """ + super().__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(_serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + _validation = { + "private_link_service_id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "group_id": {"key": "groupId", "type": "str"}, + "required_members": {"key": "requiredMembers", "type": "[str]"}, + "private_link_service_id": {"key": "privateLinkServiceID", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ + super().__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.group_id = group_id + self.required_members = required_members + self.private_link_service_id = None + + +class PrivateLinkResourcesListResult(_serialization.Model): + """A list of private link resources. + + :ivar value: The collection value. + :vartype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateLinkResource]"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateLinkResource] + """ + super().__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(_serialization.Model): + """The state of a private link service connection. + + :ivar status: The private link service connection status. Known values are: "Pending", + "Approved", "Rejected", and "Disconnected". + :vartype status: str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str + """ + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "_models.ConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword status: The private link service connection status. Known values are: "Pending", + "Approved", "Rejected", and "Disconnected". + :paramtype status: str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ + super().__init__(**kwargs) + self.status = status + self.description = description + + +class RelativeMonthlySchedule(_serialization.Model): + """For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last + Friday'. + + All required parameters must be populated in order to send to server. + + :ivar interval_months: Specifies the number of months between each set of occurrences. + Required. + :vartype interval_months: int + :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.v2024_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.v2024_02_02_preview.models.WeekDay + """ + + _validation = { + "interval_months": {"required": True, "maximum": 6, "minimum": 1}, + "week_index": {"required": True}, + "day_of_week": {"required": True}, + } + + _attribute_map = { + "interval_months": {"key": "intervalMonths", "type": "int"}, + "week_index": {"key": "weekIndex", "type": "str"}, + "day_of_week": {"key": "dayOfWeek", "type": "str"}, + } + + def __init__( + self, + *, + interval_months: int, + week_index: Union[str, "_models.Type"], + day_of_week: Union[str, "_models.WeekDay"], + **kwargs: Any + ) -> None: + """ + :keyword interval_months: Specifies the number of months between each set of occurrences. + Required. + :paramtype interval_months: int + :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.v2024_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.v2024_02_02_preview.models.WeekDay + """ + super().__init__(**kwargs) + self.interval_months = interval_months + self.week_index = week_index + self.day_of_week = day_of_week + + +class ResourceReference(_serialization.Model): + """A reference to an Azure resource. + + :ivar id: The fully qualified Azure resource id. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class RunCommandRequest(_serialization.Model): + """A run command request. + + All required parameters must be populated in order to send to server. + + :ivar command: The command to run. Required. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str + """ + + _validation = { + "command": {"required": True}, + } + + _attribute_map = { + "command": {"key": "command", "type": "str"}, + "context": {"key": "context", "type": "str"}, + "cluster_token": {"key": "clusterToken", "type": "str"}, + } + + def __init__( + self, *, command: str, context: Optional[str] = None, cluster_token: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword command: The command to run. Required. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ + super().__init__(**kwargs) + self.command = command + self.context = context + self.cluster_token = cluster_token + + +class RunCommandResult(_serialization.Model): + """run command result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The command id. + :vartype id: str + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + _validation = { + "id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "exit_code": {"readonly": True}, + "started_at": {"readonly": True}, + "finished_at": {"readonly": True}, + "logs": {"readonly": True}, + "reason": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "exit_code": {"key": "properties.exitCode", "type": "int"}, + "started_at": {"key": "properties.startedAt", "type": "iso-8601"}, + "finished_at": {"key": "properties.finishedAt", "type": "iso-8601"}, + "logs": {"key": "properties.logs", "type": "str"}, + "reason": {"key": "properties.reason", "type": "str"}, + } + + 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 + + +class SafeguardsAvailableVersion(Resource): + """Available Safeguards Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_02_02_preview.models.SystemData + :ivar properties: Whether the version is default or not and support info. Required. + :vartype properties: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.SafeguardsAvailableVersionsProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "SafeguardsAvailableVersionsProperties"}, + } + + def __init__(self, *, properties: "_models.SafeguardsAvailableVersionsProperties", **kwargs: Any) -> None: + """ + :keyword properties: Whether the version is default or not and support info. Required. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.SafeguardsAvailableVersionsProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class SafeguardsAvailableVersionsList(_serialization.Model): + """Hold values properties, which is array of SafeguardsVersions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of AKS supported Safeguards versions. + :vartype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.SafeguardsAvailableVersion] + :ivar next_link: The URL to get the next Safeguards available version. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[SafeguardsAvailableVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.SafeguardsAvailableVersion"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Array of AKS supported Safeguards versions. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.SafeguardsAvailableVersion] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class SafeguardsAvailableVersionsProperties(_serialization.Model): + """Whether the version is default or not and support info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_default_version: + :vartype is_default_version: bool + :ivar support: Whether the version is preview or stable. Known values are: "Preview" and + "Stable". + :vartype support: str or + ~azure.mgmt.containerservice.v2024_02_02_preview.models.SafeguardsSupport + """ + + _validation = { + "is_default_version": {"readonly": True}, + "support": {"readonly": True}, + } + + _attribute_map = { + "is_default_version": {"key": "isDefaultVersion", "type": "bool"}, + "support": {"key": "support", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.is_default_version = None + self.support = None + + +class SafeguardsProfile(_serialization.Model): + """The Safeguards profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar system_excluded_namespaces: List of namespaces specified by AKS to be excluded from + Safeguards. + :vartype system_excluded_namespaces: list[str] + :ivar version: The version of constraints to use. + :vartype version: str + :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.v2024_02_02_preview.models.Level + :ivar excluded_namespaces: List of namespaces excluded from Safeguards checks. + :vartype excluded_namespaces: list[str] + """ + + _validation = { + "system_excluded_namespaces": {"readonly": True}, + "level": {"required": True}, + } + + _attribute_map = { + "system_excluded_namespaces": {"key": "systemExcludedNamespaces", "type": "[str]"}, + "version": {"key": "version", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "excluded_namespaces": {"key": "excludedNamespaces", "type": "[str]"}, + } + + def __init__( + self, + *, + level: Union[str, "_models.Level"], + version: Optional[str] = None, + excluded_namespaces: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: The version of constraints to use. + :paramtype version: str + :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.v2024_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.version = version + self.level = level + self.excluded_namespaces = excluded_namespaces + + +class ScaleProfile(_serialization.Model): + """Specifications on how to scale a VirtualMachines agent pool. + + :ivar manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. + :vartype manual: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManualScaleProfile] + """ + + _attribute_map = { + "manual": {"key": "manual", "type": "[ManualScaleProfile]"}, + } + + def __init__(self, *, manual: Optional[List["_models.ManualScaleProfile"]] = 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.v2024_02_02_preview.models.ManualScaleProfile] + """ + super().__init__(**kwargs) + self.manual = manual + + +class Schedule(_serialization.Model): + """One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', + '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.v2024_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.v2024_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.v2024_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.v2024_02_02_preview.models.RelativeMonthlySchedule + """ + + _attribute_map = { + "daily": {"key": "daily", "type": "DailySchedule"}, + "weekly": {"key": "weekly", "type": "WeeklySchedule"}, + "absolute_monthly": {"key": "absoluteMonthly", "type": "AbsoluteMonthlySchedule"}, + "relative_monthly": {"key": "relativeMonthly", "type": "RelativeMonthlySchedule"}, + } + + def __init__( + self, + *, + daily: Optional["_models.DailySchedule"] = None, + weekly: Optional["_models.WeeklySchedule"] = None, + absolute_monthly: Optional["_models.AbsoluteMonthlySchedule"] = None, + relative_monthly: Optional["_models.RelativeMonthlySchedule"] = None, + **kwargs: Any + ) -> None: + """ + :keyword daily: For schedules like: 'recur every day' or 'recur every 3 days'. + :paramtype daily: ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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.v2024_02_02_preview.models.RelativeMonthlySchedule + """ + super().__init__(**kwargs) + self.daily = daily + self.weekly = weekly + self.absolute_monthly = absolute_monthly + self.relative_monthly = relative_monthly + + +class ServiceMeshProfile(_serialization.Model): + """Service mesh profile for a managed cluster. + + 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.v2024_02_02_preview.models.ServiceMeshMode + :ivar istio: Istio service mesh configuration. + :vartype istio: ~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioServiceMesh + """ + + _validation = { + "mode": {"required": True}, + } + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + "istio": {"key": "istio", "type": "IstioServiceMesh"}, + } + + def __init__( + self, + *, + mode: Union[str, "_models.ServiceMeshMode"], + istio: Optional["_models.IstioServiceMesh"] = None, + **kwargs: Any + ) -> None: + """ + :keyword mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". + :paramtype mode: str or ~azure.mgmt.containerservice.v2024_02_02_preview.models.ServiceMeshMode + :keyword istio: Istio service mesh configuration. + :paramtype istio: ~azure.mgmt.containerservice.v2024_02_02_preview.models.IstioServiceMesh + """ + super().__init__(**kwargs) + self.mode = mode + self.istio = istio + + +class Snapshot(TrackedResource): # pylint: disable=too-many-instance-attributes + """A node pool snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_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.v2024_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.v2024_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.v2024_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.v2024_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. + :vartype enable_fips: bool + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "kubernetes_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "os_type": {"readonly": True}, + "os_sku": {"readonly": True}, + "vm_size": {"readonly": True}, + "enable_fips": {"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}"}, + "location": {"key": "location", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "snapshot_type": {"key": "properties.snapshotType", "type": "str"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "node_image_version": {"key": "properties.nodeImageVersion", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "os_sku": {"key": "properties.osSku", "type": "str"}, + "vm_size": {"key": "properties.vmSize", "type": "str"}, + "enable_fips": {"key": "properties.enableFIPS", "type": "bool"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["_models.CreationData"] = None, + snapshot_type: Union[str, "_models.SnapshotType"] = "NodePool", + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :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.v2024_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.v2024_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 + + +class SnapshotListResult(_serialization.Model): + """The response from the List Snapshots operation. + + 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.v2024_02_02_preview.models.Snapshot] + :ivar next_link: The URL to get the next set of snapshot results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Snapshot]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.Snapshot"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of snapshots. + :paramtype value: list[~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class SysctlConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Sysctl settings for Linux agent nodes. + + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int + """ + + _validation = { + "net_ipv4_tcpkeepalive_intvl": {"maximum": 90, "minimum": 10}, + "net_netfilter_nf_conntrack_max": {"maximum": 2097152, "minimum": 131072}, + "net_netfilter_nf_conntrack_buckets": {"maximum": 524288, "minimum": 65536}, + } + + _attribute_map = { + "net_core_somaxconn": {"key": "netCoreSomaxconn", "type": "int"}, + "net_core_netdev_max_backlog": {"key": "netCoreNetdevMaxBacklog", "type": "int"}, + "net_core_rmem_default": {"key": "netCoreRmemDefault", "type": "int"}, + "net_core_rmem_max": {"key": "netCoreRmemMax", "type": "int"}, + "net_core_wmem_default": {"key": "netCoreWmemDefault", "type": "int"}, + "net_core_wmem_max": {"key": "netCoreWmemMax", "type": "int"}, + "net_core_optmem_max": {"key": "netCoreOptmemMax", "type": "int"}, + "net_ipv4_tcp_max_syn_backlog": {"key": "netIpv4TcpMaxSynBacklog", "type": "int"}, + "net_ipv4_tcp_max_tw_buckets": {"key": "netIpv4TcpMaxTwBuckets", "type": "int"}, + "net_ipv4_tcp_fin_timeout": {"key": "netIpv4TcpFinTimeout", "type": "int"}, + "net_ipv4_tcp_keepalive_time": {"key": "netIpv4TcpKeepaliveTime", "type": "int"}, + "net_ipv4_tcp_keepalive_probes": {"key": "netIpv4TcpKeepaliveProbes", "type": "int"}, + "net_ipv4_tcpkeepalive_intvl": {"key": "netIpv4TcpkeepaliveIntvl", "type": "int"}, + "net_ipv4_tcp_tw_reuse": {"key": "netIpv4TcpTwReuse", "type": "bool"}, + "net_ipv4_ip_local_port_range": {"key": "netIpv4IpLocalPortRange", "type": "str"}, + "net_ipv4_neigh_default_gc_thresh1": {"key": "netIpv4NeighDefaultGcThresh1", "type": "int"}, + "net_ipv4_neigh_default_gc_thresh2": {"key": "netIpv4NeighDefaultGcThresh2", "type": "int"}, + "net_ipv4_neigh_default_gc_thresh3": {"key": "netIpv4NeighDefaultGcThresh3", "type": "int"}, + "net_netfilter_nf_conntrack_max": {"key": "netNetfilterNfConntrackMax", "type": "int"}, + "net_netfilter_nf_conntrack_buckets": {"key": "netNetfilterNfConntrackBuckets", "type": "int"}, + "fs_inotify_max_user_watches": {"key": "fsInotifyMaxUserWatches", "type": "int"}, + "fs_file_max": {"key": "fsFileMax", "type": "int"}, + "fs_aio_max_nr": {"key": "fsAioMaxNr", "type": "int"}, + "fs_nr_open": {"key": "fsNrOpen", "type": "int"}, + "kernel_threads_max": {"key": "kernelThreadsMax", "type": "int"}, + "vm_max_map_count": {"key": "vmMaxMapCount", "type": "int"}, + "vm_swappiness": {"key": "vmSwappiness", "type": "int"}, + "vm_vfs_cache_pressure": {"key": "vmVfsCachePressure", "type": "int"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + net_core_somaxconn: Optional[int] = None, + net_core_netdev_max_backlog: Optional[int] = None, + net_core_rmem_default: Optional[int] = None, + net_core_rmem_max: Optional[int] = None, + net_core_wmem_default: Optional[int] = None, + net_core_wmem_max: Optional[int] = None, + net_core_optmem_max: Optional[int] = None, + net_ipv4_tcp_max_syn_backlog: Optional[int] = None, + net_ipv4_tcp_max_tw_buckets: Optional[int] = None, + net_ipv4_tcp_fin_timeout: Optional[int] = None, + net_ipv4_tcp_keepalive_time: Optional[int] = None, + net_ipv4_tcp_keepalive_probes: Optional[int] = None, + net_ipv4_tcpkeepalive_intvl: Optional[int] = None, + net_ipv4_tcp_tw_reuse: Optional[bool] = None, + net_ipv4_ip_local_port_range: Optional[str] = None, + net_ipv4_neigh_default_gc_thresh1: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh2: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh3: Optional[int] = None, + net_netfilter_nf_conntrack_max: Optional[int] = None, + net_netfilter_nf_conntrack_buckets: Optional[int] = None, + fs_inotify_max_user_watches: Optional[int] = None, + fs_file_max: Optional[int] = None, + fs_aio_max_nr: Optional[int] = None, + fs_nr_open: Optional[int] = None, + kernel_threads_max: Optional[int] = None, + vm_max_map_count: Optional[int] = None, + vm_swappiness: Optional[int] = None, + vm_vfs_cache_pressure: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ + super().__init__(**kwargs) + self.net_core_somaxconn = net_core_somaxconn + self.net_core_netdev_max_backlog = net_core_netdev_max_backlog + self.net_core_rmem_default = net_core_rmem_default + self.net_core_rmem_max = net_core_rmem_max + self.net_core_wmem_default = net_core_wmem_default + self.net_core_wmem_max = net_core_wmem_max + self.net_core_optmem_max = net_core_optmem_max + self.net_ipv4_tcp_max_syn_backlog = net_ipv4_tcp_max_syn_backlog + self.net_ipv4_tcp_max_tw_buckets = net_ipv4_tcp_max_tw_buckets + self.net_ipv4_tcp_fin_timeout = net_ipv4_tcp_fin_timeout + self.net_ipv4_tcp_keepalive_time = net_ipv4_tcp_keepalive_time + self.net_ipv4_tcp_keepalive_probes = net_ipv4_tcp_keepalive_probes + self.net_ipv4_tcpkeepalive_intvl = net_ipv4_tcpkeepalive_intvl + self.net_ipv4_tcp_tw_reuse = net_ipv4_tcp_tw_reuse + self.net_ipv4_ip_local_port_range = net_ipv4_ip_local_port_range + self.net_ipv4_neigh_default_gc_thresh1 = net_ipv4_neigh_default_gc_thresh1 + self.net_ipv4_neigh_default_gc_thresh2 = net_ipv4_neigh_default_gc_thresh2 + self.net_ipv4_neigh_default_gc_thresh3 = net_ipv4_neigh_default_gc_thresh3 + self.net_netfilter_nf_conntrack_max = net_netfilter_nf_conntrack_max + self.net_netfilter_nf_conntrack_buckets = net_netfilter_nf_conntrack_buckets + self.fs_inotify_max_user_watches = fs_inotify_max_user_watches + self.fs_file_max = fs_file_max + self.fs_aio_max_nr = fs_aio_max_nr + self.fs_nr_open = fs_nr_open + self.kernel_threads_max = kernel_threads_max + self.vm_max_map_count = vm_max_map_count + self.vm_swappiness = vm_swappiness + self.vm_vfs_cache_pressure = vm_vfs_cache_pressure + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :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.v2024_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. + :vartype last_modified_by: str + :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.v2024_02_02_preview.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :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.v2024_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. + :paramtype last_modified_by: str + :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.v2024_02_02_preview.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TagsObject(_serialization.Model): + """Tags object for patch operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class TimeInWeek(_serialization.Model): + """Time in a week. + + :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.v2024_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. + :vartype hour_slots: list[int] + """ + + _attribute_map = { + "day": {"key": "day", "type": "str"}, + "hour_slots": {"key": "hourSlots", "type": "[int]"}, + } + + def __init__( + self, + *, + day: Optional[Union[str, "_models.WeekDay"]] = None, + hour_slots: Optional[List[int]] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_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. + :paramtype hour_slots: list[int] + """ + super().__init__(**kwargs) + self.day = day + self.hour_slots = hour_slots + + +class TimeSpan(_serialization.Model): + """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime + """ + + _attribute_map = { + "start": {"key": "start", "type": "iso-8601"}, + "end": {"key": "end", "type": "iso-8601"}, + } + + def __init__( + self, *, start: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ + super().__init__(**kwargs) + self.start = start + self.end = end + + +class TrustedAccessRole(_serialization.Model): + """Trusted access role definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar source_resource_type: Resource type of Azure resource. + :vartype source_resource_type: str + :ivar name: Name of role, name is unique under a source resource type. + :vartype name: str + :ivar rules: List of rules for the role. This maps to 'rules' property of `Kubernetes Cluster + Role + `_. + :vartype rules: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.TrustedAccessRoleRule] + """ + + _validation = { + "source_resource_type": {"readonly": True}, + "name": {"readonly": True}, + "rules": {"readonly": True}, + } + + _attribute_map = { + "source_resource_type": {"key": "sourceResourceType", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "rules": {"key": "rules", "type": "[TrustedAccessRoleRule]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.source_resource_type = None + self.name = None + self.rules = None + + +class TrustedAccessRoleBinding(Resource): + """Defines binding between a resource and role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_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.v2024_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 + :ivar roles: A list of roles to bind, each item is a resource type qualified role name. For + example: 'Microsoft.MachineLearningServices/workspaces/reader'. Required. + :vartype roles: list[str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "source_resource_id": {"required": True}, + "roles": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "source_resource_id": {"key": "properties.sourceResourceId", "type": "str"}, + "roles": {"key": "properties.roles", "type": "[str]"}, + } + + def __init__(self, *, source_resource_id: str, roles: List[str], **kwargs: Any) -> None: + """ + :keyword source_resource_id: The ARM resource ID of source resource that trusted access is + configured for. Required. + :paramtype source_resource_id: str + :keyword roles: A list of roles to bind, each item is a resource type qualified role name. For + example: 'Microsoft.MachineLearningServices/workspaces/reader'. Required. + :paramtype roles: list[str] + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.source_resource_id = source_resource_id + self.roles = roles + + +class TrustedAccessRoleBindingListResult(_serialization.Model): + """List of trusted access role bindings. + + 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.v2024_02_02_preview.models.TrustedAccessRoleBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[TrustedAccessRoleBinding]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.TrustedAccessRoleBinding"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Role binding list. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_02_02_preview.models.TrustedAccessRoleBinding] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class TrustedAccessRoleListResult(_serialization.Model): + """List of trusted access roles. + + 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.v2024_02_02_preview.models.TrustedAccessRole] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[TrustedAccessRole]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class TrustedAccessRoleRule(_serialization.Model): + """Rule for trusted access role. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar verbs: List of allowed verbs. + :vartype verbs: list[str] + :ivar api_groups: List of allowed apiGroups. + :vartype api_groups: list[str] + :ivar resources: List of allowed resources. + :vartype resources: list[str] + :ivar resource_names: List of allowed names. + :vartype resource_names: list[str] + :ivar non_resource_ur_ls: List of allowed nonResourceURLs. + :vartype non_resource_ur_ls: list[str] + """ + + _validation = { + "verbs": {"readonly": True}, + "api_groups": {"readonly": True}, + "resources": {"readonly": True}, + "resource_names": {"readonly": True}, + "non_resource_ur_ls": {"readonly": True}, + } + + _attribute_map = { + "verbs": {"key": "verbs", "type": "[str]"}, + "api_groups": {"key": "apiGroups", "type": "[str]"}, + "resources": {"key": "resources", "type": "[str]"}, + "resource_names": {"key": "resourceNames", "type": "[str]"}, + "non_resource_ur_ls": {"key": "nonResourceURLs", "type": "[str]"}, + } + + 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 + + +class UpgradeOverrideSettings(_serialization.Model): + """Settings for overrides when upgrading a cluster. + + :ivar force_upgrade: Whether to force upgrade the cluster. Note that this option instructs + upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + Enable this option only with caution. + :vartype force_upgrade: bool + :ivar until: Until when the overrides are effective. Note that this only matches the start time + of an upgrade, and the effectiveness won't change once an upgrade starts even if the ``until`` + expires as upgrade proceeds. This field is not set by default. It must be set for the overrides + to take effect. + :vartype until: ~datetime.datetime + """ + + _attribute_map = { + "force_upgrade": {"key": "forceUpgrade", "type": "bool"}, + "until": {"key": "until", "type": "iso-8601"}, + } + + def __init__( + self, *, force_upgrade: Optional[bool] = None, until: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """ + :keyword force_upgrade: Whether to force upgrade the cluster. Note that this option instructs + upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + Enable this option only with caution. + :paramtype force_upgrade: bool + :keyword until: Until when the overrides are effective. Note that this only matches the start + time of an upgrade, and the effectiveness won't change once an upgrade starts even if the + ``until`` expires as upgrade proceeds. This field is not set by default. It must be set for the + overrides to take effect. + :paramtype until: ~datetime.datetime + """ + super().__init__(**kwargs) + self.force_upgrade = force_upgrade + self.until = until + + +class VirtualMachineNodes(_serialization.Model): + """Current status on a group of nodes of the same vm size. + + :ivar size: The VM size of the agents used to host this group of nodes. + :vartype size: str + :ivar count: Number of nodes. + :vartype count: int + """ + + _attribute_map = { + "size": {"key": "size", "type": "str"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, size: Optional[str] = None, count: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword size: The VM size of the agents used to host this group of nodes. + :paramtype size: str + :keyword count: Number of nodes. + :paramtype count: int + """ + super().__init__(**kwargs) + self.size = size + self.count = count + + +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.v2024_02_02_preview.models.ScaleProfile + """ + + _attribute_map = { + "scale": {"key": "scale", "type": "ScaleProfile"}, + } + + 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.v2024_02_02_preview.models.ScaleProfile + """ + super().__init__(**kwargs) + self.scale = scale + + +class WeeklySchedule(_serialization.Model): + """For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + + All required parameters must be populated in order to send to server. + + :ivar interval_weeks: Specifies the number of weeks between each set of occurrences. Required. + :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.v2024_02_02_preview.models.WeekDay + """ + + _validation = { + "interval_weeks": {"required": True, "maximum": 4, "minimum": 1}, + "day_of_week": {"required": True}, + } + + _attribute_map = { + "interval_weeks": {"key": "intervalWeeks", "type": "int"}, + "day_of_week": {"key": "dayOfWeek", "type": "str"}, + } + + def __init__(self, *, interval_weeks: int, day_of_week: Union[str, "_models.WeekDay"], **kwargs: Any) -> None: + """ + :keyword interval_weeks: Specifies the number of weeks between each set of occurrences. + Required. + :paramtype interval_weeks: int + :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.v2024_02_02_preview.models.WeekDay + """ + super().__init__(**kwargs) + self.interval_weeks = interval_weeks + self.day_of_week = day_of_week + + +class WindowsGmsaProfile(_serialization.Model): + """Windows gMSA Profile in the managed cluster. + + :ivar enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :vartype enabled: bool + :ivar dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it to + empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :vartype dns_server: str + :ivar root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :vartype root_domain_name: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "dns_server": {"key": "dnsServer", "type": "str"}, + "root_domain_name": {"key": "rootDomainName", "type": "str"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + dns_server: Optional[str] = None, + root_domain_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :paramtype enabled: bool + :keyword dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it + to empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :paramtype dns_server: str + :keyword root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :paramtype root_domain_name: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.dns_server = dns_server + self.root_domain_name = root_domain_name diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_02_02_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/__init__.py new file mode 100644 index 000000000000..a035074bb195 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/__init__.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._machines_operations import MachinesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._operation_status_result_operations import OperationStatusResultOperations +from ._snapshots_operations import SnapshotsOperations +from ._managed_cluster_snapshots_operations import ManagedClusterSnapshotsOperations +from ._trusted_access_roles_operations import TrustedAccessRolesOperations +from ._trusted_access_role_bindings_operations import TrustedAccessRoleBindingsOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "MachinesOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "OperationStatusResultOperations", + "SnapshotsOperations", + "ManagedClusterSnapshotsOperations", + "TrustedAccessRolesOperations", + "TrustedAccessRoleBindingsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..c51a8c88e355 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_agent_pools_operations.py @@ -0,0 +1,1537 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_abort_latest_operation_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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) + + +def build_list_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", "2024-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( + "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, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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}/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", 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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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, + agent_pool_name: str, + subscription_id: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ignore_pod_disruption_budget is not None: + _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( + "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_upgrade_profile_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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_delete_machines_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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}/agentPools/{agentPoolName}/deleteMachines", + ) # 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", 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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_available_agent_pool_versions_request( # pylint: disable=name-too-long + 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", "2024-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( + "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_upgrade_node_image_version_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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 AgentPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`agent_pools` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Aborts last operation running on agent pool. + + Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + completes before cancellation can take place, an error is returned. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_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 "2024-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterable["_models.AgentPool"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AgentPoolListResult", 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, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPool: + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :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 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.v2024_02_02_preview.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPool", pipeline_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, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + **kwargs: Any + ) -> _models.AgentPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentPool] = 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, "AgentPool") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AgentPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AgentPool", pipeline_response) + + 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, + agent_pool_name: str, + parameters: _models.AgentPool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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.v2024_02_02_preview.models.AgentPool + :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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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: 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_02_02_preview.models.AgentPool or + IO[bytes] + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + 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) + 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, + agent_pool_name=agent_pool_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AgentPool", pipeline_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.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 "2024-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + @distributed_trace + def get_upgrade_profile( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPoolUpgradeProfile: + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :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 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.v2024_02_02_preview.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_machines_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(machines, (IOBase, bytes)): + _content = machines + else: + _json = self._serialize.body(machines, "AgentPoolDeleteMachinesParameter") + + _request = build_delete_machines_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: _models.AgentPoolDeleteMachinesParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: + ~azure.mgmt.containerservice.v2024_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 + :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: + """ + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_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] + :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 "2024-02-02-preview") + ) + 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) + 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_machines_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machines=machines, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 + + @distributed_trace + def get_available_agent_pool_versions( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.AgentPoolAvailableVersions: + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :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: AgentPoolAvailableVersions or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) + + _request = build_get_available_agent_pool_versions_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _upgrade_node_image_version_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Optional[_models.AgentPool]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[Optional[_models.AgentPool]] = kwargs.pop("cls", None) + + _request = build_upgrade_node_image_version_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_upgrade_node_image_version( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_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 "2024-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._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_machines_operations.py new file mode 100644 index 000000000000..2164bee9895a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_machines_operations.py @@ -0,0 +1,317 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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, + agent_pool_name: str, + machine_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", pattern=r"^[a-zA-Z0-9][-_a-zA-Z0-9]{0,39}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class MachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`machines` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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, agent_pool_name: str, **kwargs: Any + ) -> Iterable["_models.Machine"]: + """Gets a list of machines in the specified agent pool. + + Gets a list of machines in the specified agent pool. + + :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 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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MachineListResult", 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, agent_pool_name: str, machine_name: str, **kwargs: Any + ) -> _models.Machine: + """Get a specific machine in the specified agent pool. + + Get a specific machine in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_02_02_preview.models.Machine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Machine", pipeline_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/v2024_02_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..0ceda241ad3c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_maintenance_configurations_operations.py @@ -0,0 +1,601 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_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", "2024-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( + "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, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, resource_name: str, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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}/maintenanceConfigurations/{configName}", + ) # 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", 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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _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, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`maintenance_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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.MaintenanceConfiguration"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations 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 MaintenanceConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationListResult", 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, config_name: str, **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration 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 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.v2024_02_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: _models.MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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.v2024_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.v2024_02_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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: 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: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: Union[_models.MaintenanceConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 config_name: The name of the maintenance configuration. Required. + :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.v2024_02_02_preview.models.MaintenanceConfiguration or IO[bytes] + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceConfiguration] = 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, "MaintenanceConfiguration") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :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 config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_managed_cluster_snapshots_operations.py new file mode 100644 index 000000000000..519c30701209 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -0,0 +1,858 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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"), + } + + _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_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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_create_or_update_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", "2024-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/managedclustersnapshots/{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", 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 + 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_update_tags_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", "2024-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/managedclustersnapshots/{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", 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 + 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_delete_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", "2024-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( + "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class ManagedClusterSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`managed_cluster_snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: + """Gets a list of managed cluster snapshots in the specified subscription. + + Gets a list of managed cluster snapshots in the specified subscription. + + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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 list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.ManagedClusterSnapshot"]: + """Lists managed cluster snapshots in the specified subscription and resource group. + + Lists managed cluster snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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, **kwargs: Any) -> _models.ManagedClusterSnapshot: + """Gets a managed cluster snapshot. + + Gets a managed cluster snapshot. + + :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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterSnapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot to create or update. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterSnapshot, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 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.v2024_02_02_preview.models.ManagedClusterSnapshot or IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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, "ManagedClusterSnapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 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.v2024_02_02_preview.models.TagsObject or + IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a managed cluster snapshot. + + Deletes a managed cluster snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..3fdda4fa1dcf --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_managed_clusters_operations.py @@ -0,0 +1,4381 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_os_options_request( + location: str, subscription_id: str, *, resource_type: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default", + ) # 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), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if resource_type is not None: + _params["resource-type"] = _SERIALIZER.query("resource_type", resource_type, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_kubernetes_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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), + } + + _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_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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_upgrade_profile_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", "2024-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( + "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_access_profile_request( + resource_group_name: str, resource_name: str, role_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "roleName": _SERIALIZER.url("role_name", role_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_admin_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_user_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_monitoring_user_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_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", "2024-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( + "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_create_or_update_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", "2024-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}", + ) # 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", 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 + 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_update_tags_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", "2024-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}", + ) # 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", 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 + 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_delete_request( + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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") + if ignore_pod_disruption_budget is not None: + _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( + "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_reset_service_principal_profile_request( # pylint: disable=name-too-long + 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", "2024-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_reset_aad_profile_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", "2024-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_abort_latest_operation_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", "2024-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_rotate_cluster_certificates_request( # pylint: disable=name-too-long + 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", "2024-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_rotate_service_account_signing_keys_request( # pylint: disable=name-too-long + 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", "2024-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_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", "2024-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_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", "2024-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_run_command_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", "2024-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}/runCommand", + ) # 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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_command_result_request( + resource_group_name: str, resource_name: str, command_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "commandId": _SERIALIZER.url("command_id", command_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_outbound_network_dependencies_endpoints_request( # pylint: disable=name-too-long + 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", "2024-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( + "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_guardrails_versions_request( + location: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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), + "version": _SERIALIZER.url("version", version, "str", max_length=24, min_length=1), + } + + _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_list_guardrails_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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), + } + + _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_safeguards_versions_request( + location: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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), + "version": _SERIALIZER.url("version", version, "str", max_length=24, min_length=1), + } + + _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_list_safeguards_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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), + } + + _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_list_mesh_revision_profiles_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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), + } + + _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_mesh_revision_profile_request( + location: str, mode: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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), + "mode": _SERIALIZER.url( + "mode", + mode, + "str", + max_length=24, + 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_list_mesh_upgrade_profiles_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", "2024-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( + "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_mesh_upgrade_profile_request( + resource_group_name: str, resource_name: str, mode: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "mode": _SERIALIZER.url( + "mode", + mode, + "str", + max_length=24, + 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) + + +class ManagedClustersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`managed_clusters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get_os_options( + self, location: str, resource_type: Optional[str] = None, **kwargs: Any + ) -> _models.OSOptionProfile: + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. Default + value is None. + :type resource_type: str + :return: OSOptionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.OSOptionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.OSOptionProfile] = kwargs.pop("cls", None) + + _request = build_get_os_options_request( + location=location, + subscription_id=self._config.subscription_id, + resource_type=resource_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OSOptionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: + """Gets a list of supported Kubernetes versions in the specified subscription. + + Contains extra metadata on the version, including supported patch versions, capabilities, + available upgrades, and details on preview status of the version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: KubernetesVersionListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.KubernetesVersionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) + + _request = build_list_kubernetes_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("KubernetesVersionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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 list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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_upgrade_profile( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.ManagedClusterUpgradeProfile: + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile 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 + :return: ManagedClusterUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_access_profile( + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any + ) -> _models.ManagedClusterAccessProfile: + """Gets an access profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :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 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.v2024_02_02_preview.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) + + _request = build_get_access_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_admin_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials 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 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.v2024_02_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_admin_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any + ) -> _models.CredentialResults: + """Lists the user credentials of a managed cluster. + + Lists the user credentials 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :type server_fqdn: str + :param format: Only apply to AAD clusters, specifies the format of returned kubeconfig. Format + '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" and "exec". + Default value is None. + :type format: str or ~azure.mgmt.containerservice.v2024_02_02_preview.models.Format + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + format=format, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_monitoring_user_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials 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 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.v2024_02_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_monitoring_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: + """Gets a managed cluster. + + Gets 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 + :return: ManagedCluster or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_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, + parameters: Union[_models.ManagedCluster, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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, "ManagedCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + 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, + parameters: _models.ManagedCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster 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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedCluster, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Is either a ManagedCluster type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster or + IO[bytes] + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + 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) + 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, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. 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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 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.v2024_02_02_preview.models.TagsObject or + IO[bytes] + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + 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) + 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._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a managed cluster. + + Deletes 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 ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 "2024-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterServicePrincipalProfile") + + _request = build_reset_service_principal_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterServicePrincipalProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_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 + :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: + """ + + @overload + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 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.v2024_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] + :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 "2024-02-02-preview") + ) + 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) + 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._reset_service_principal_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterAADProfile") + + _request = build_reset_aad_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterAADProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_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 + :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: + """ + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 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.v2024_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: + """ + _headers = case_insensitive_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 "2024-02-02-preview") + ) + 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) + 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._reset_aad_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Aborts last operation running on managed cluster. + + Aborts the currently running operation on the managed cluster. The Managed Cluster will be + moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If + the operation completes before cancellation can take place, an error is returned. + + :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 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 "2024-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_cluster_certificates_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_rotate_cluster_certificates( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :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 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 "2024-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._rotate_cluster_certificates_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_service_account_signing_keys_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Rotates the service account signing keys of a managed cluster. + + Rotates the service account signing keys 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 + :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 "2024-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._rotate_service_account_signing_keys_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + 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 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 "2024-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._stop_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a 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 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 "2024-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._start_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_payload, (IOBase, bytes)): + _content = request_payload + else: + _json = self._serialize.body(request_payload, "RunCommandRequest") + + _request = build_run_command_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: _models.RunCommandRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: 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 RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Is either a RunCommandRequest type or a + IO[bytes] type. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_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.v2024_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 "2024-02-02-preview") + ) + 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) + 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._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RunCommandResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RunCommandResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RunCommandResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_command_result( + self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the 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 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.v2024_02_02_preview.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + _request = build_get_command_result_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpoint"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :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 OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_outbound_network_dependencies_endpoints_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", 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_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> _models.GuardrailsAvailableVersion: + """Gets supported Guardrails version in the specified subscription and location. + + Contains Guardrails version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: GuardrailsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.GuardrailsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_guardrails_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GuardrailsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_models.GuardrailsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either GuardrailsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_guardrails_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GuardrailsAvailableVersionsList", 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_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> _models.SafeguardsAvailableVersion: + """Gets supported Safeguards version in the specified subscription and location. + + Contains Safeguards version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: SafeguardsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.SafeguardsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_safeguards_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SafeguardsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_safeguards_versions(self, location: str, **kwargs: Any) -> Iterable["_models.SafeguardsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either SafeguardsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_safeguards_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SafeguardsAvailableVersionsList", 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 list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable["_models.MeshRevisionProfile"]: + """Lists mesh revision profiles for all meshes in the specified location. + + Contains extra metadata on each revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_revision_profiles_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MeshRevisionProfileList", 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_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: + """Gets a mesh revision profile for a specified mesh in the specified location. + + Contains extra metadata on the revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshRevisionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshRevisionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_revision_profile_request( + location=location, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshRevisionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_upgrade_profiles( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterable["_models.MeshUpgradeProfile"]: + """Lists available upgrades for all service meshes in a specific cluster. + + Lists available upgrades for all service meshes in a specific 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 MeshUpgradeProfile or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_upgrade_profiles_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MeshUpgradeProfileList", 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_mesh_upgrade_profile( + self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any + ) -> _models.MeshUpgradeProfile: + """Gets available upgrades for a service mesh in a cluster. + + Gets available upgrades for a service mesh in a 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 mode: The mode of the mesh. Required. + :type mode: str + :return: MeshUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.MeshUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshUpgradeProfile", pipeline_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/v2024_02_02_preview/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_operation_status_result_operations.py new file mode 100644 index 000000000000..53a1bd882b47 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_operation_status_result_operations.py @@ -0,0 +1,416 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-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( + "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, operation_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str", min_length=1), + } + + _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_by_agent_pool_request( + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + operation_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class OperationStatusResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`operation_status_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> Iterable["_models.OperationStatusResult"]: + """Gets a list of operations in the specified managedCluster. + + Gets a list of operations in the specified managedCluster. + + :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 OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusResultList", 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, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified managed cluster. + + Get the status of a specific operation 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 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.v2024_02_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_by_agent_pool( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified agent pool. + + Get the status of a specific operation in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_02_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_by_agent_pool_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_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/v2024_02_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_operations.py new file mode 100644 index 000000000000..9ae785ba8ff9 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_operations.py @@ -0,0 +1,161 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +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", "2024-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.ContainerService/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: + """Gets a list of operations. + + Gets a list of operations. + + :return: An iterator like instance of either OperationValue or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_02_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..71fdefa02274 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,638 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-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( + "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, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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}/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", 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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _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, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> _models.PrivateEndpointConnectionListResult: + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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 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.v2024_02_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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.v2024_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.v2024_02_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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: 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: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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. Is either a + PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = 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, "PrivateEndpointConnection") + + _request = build_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_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 "2024-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..6be067c0cec6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,163 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-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( + "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) + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`private_link_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> _models.PrivateLinkResourcesListResult: + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_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/v2024_02_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..b0ef99e8bc41 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,244 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_post_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", "2024-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ResolvePrivateLinkServiceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`resolve_private_link_service_id` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.PrivateLinkResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. 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: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.PrivateLinkResource, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 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.v2024_02_02_preview.models.PrivateLinkResource + or IO[bytes] + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkResource] = 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, "PrivateLinkResource") + + _request = build_post_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResource", pipeline_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/v2024_02_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_snapshots_operations.py new file mode 100644 index 000000000000..bde2b6f3177a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_snapshots_operations.py @@ -0,0 +1,848 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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_create_or_update_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", "2024-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/snapshots/{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", 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 + 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_update_tags_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", "2024-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/snapshots/{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", 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 + 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_delete_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", "2024-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( + "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class SnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: + """Gets a list of snapshots in the specified subscription. + + 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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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 list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Snapshot"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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, **kwargs: Any) -> _models.Snapshot: + """Gets a snapshot. + + Gets a snapshot. + + :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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.Snapshot, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot or IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Snapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_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.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 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.v2024_02_02_preview.models.TagsObject or + IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_02_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_trusted_access_role_bindings_operations.py new file mode 100644 index 000000000000..19286337bdd8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -0,0 +1,750 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-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( + "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, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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_create_or_update_request( + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", + ) # 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", 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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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 + 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, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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( + "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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class TrustedAccessRoleBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`trusted_access_role_bindings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> Iterable["_models.TrustedAccessRoleBinding"]: + """List trusted access role bindings. + + List trusted access role bindings. + + :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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBindingListResult", 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, trusted_access_role_binding_name: str, **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + """Get a trusted access role binding. + + Get a trusted access role binding. + + :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 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.v2024_02_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(trusted_access_role_binding, (IOBase, bytes)): + _content = trusted_access_role_binding + else: + _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + 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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: _models.TrustedAccessRoleBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :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.v2024_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.v2024_02_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :param trusted_access_role_binding: A trusted access role binding. Required. + :type trusted_access_role_binding: 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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_02_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :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.v2024_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.v2024_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 "2024-02-02-preview") + ) + 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) + 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, + trusted_access_role_binding_name=trusted_access_role_binding_name, + trusted_access_role_binding=trusted_access_role_binding, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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.TrustedAccessRoleBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TrustedAccessRoleBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-02-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a trusted access role binding. + + Delete a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_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 "2024-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_trusted_access_roles_operations.py new file mode 100644 index 000000000000..37331e994320 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/operations/_trusted_access_roles_operations.py @@ -0,0 +1,174 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-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), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class TrustedAccessRolesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_02_02_preview.ContainerServiceClient`'s + :attr:`trusted_access_roles` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessRole"]: + """List supported trusted access roles. + + List supported trusted access roles. + + :param location: The name of the Azure region. Required. + :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.v2024_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 "2024-02-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleListResult", 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_02_02_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/__init__.py new file mode 100644 index 000000000000..4f004a298ed4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/__init__.py @@ -0,0 +1,26 @@ +# 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 ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_configuration.py new file mode 100644 index 000000000000..ab02fc286126 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ContainerServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + :keyword api_version: Api Version. Default value is "2024-03-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", "2024-03-02-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_container_service_client.py new file mode 100644 index 000000000000..a0d6b7a0b9ab --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_container_service_client.py @@ -0,0 +1,206 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy + +from . import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientConfiguration +from .operations import ( + AgentPoolsOperations, + LoadBalancersOperations, + MachinesOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + OperationStatusResultOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + ResolvePrivateLinkServiceIdOperations, + SnapshotsOperations, + TrustedAccessRoleBindingsOperations, + TrustedAccessRolesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2024_03_02_preview.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2024_03_02_preview.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2024_03_02_preview.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2024_03_02_preview.operations.AgentPoolsOperations + :ivar machines: MachinesOperations operations + :vartype machines: + azure.mgmt.containerservice.v2024_03_02_preview.operations.MachinesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2024_03_02_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2024_03_02_preview.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2024_03_02_preview.operations.ResolvePrivateLinkServiceIdOperations + :ivar operation_status_result: OperationStatusResultOperations operations + :vartype operation_status_result: + azure.mgmt.containerservice.v2024_03_02_preview.operations.OperationStatusResultOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2024_03_02_preview.operations.SnapshotsOperations + :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations + :vartype managed_cluster_snapshots: + azure.mgmt.containerservice.v2024_03_02_preview.operations.ManagedClusterSnapshotsOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.v2024_03_02_preview.operations.TrustedAccessRolesOperations + :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations + :vartype trusted_access_role_bindings: + azure.mgmt.containerservice.v2024_03_02_preview.operations.TrustedAccessRoleBindingsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: + azure.mgmt.containerservice.v2024_03_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". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-03-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 + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + 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) + + 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, "2024-03-02-preview" + ) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.machines = MachinesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.operation_status_result = OperationStatusResultOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.load_balancers = LoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "ContainerServiceClient": + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_metadata.json new file mode 100644 index 000000000000..128c74febe8e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_metadata.json @@ -0,0 +1,123 @@ +{ + "chosen_version": "2024-03-02-preview", + "total_api_version_list": ["2024-03-02-preview"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "host_value": "\"https://management.azure.com\"", + "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\"]}}, \"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\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true, + "method_location": "positional" + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. The value must be an UUID. Required.", + "docstring_type": "str", + "required": true, + "method_location": "positional" + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. The value must be an UUID. Required.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version: Optional[str]=None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles=KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "maintenance_configurations": "MaintenanceConfigurationsOperations", + "agent_pools": "AgentPoolsOperations", + "machines": "MachinesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations", + "operation_status_result": "OperationStatusResultOperations", + "snapshots": "SnapshotsOperations", + "managed_cluster_snapshots": "ManagedClusterSnapshotsOperations", + "trusted_access_roles": "TrustedAccessRolesOperations", + "trusted_access_role_bindings": "TrustedAccessRoleBindingsOperations", + "load_balancers": "LoadBalancersOperations" + } +} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_03_02_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_vendor.py new file mode 100644 index 000000000000..0dafe0e287ff --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_vendor.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/__init__.py new file mode 100644 index 000000000000..d14e96ddb36e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/__init__.py @@ -0,0 +1,23 @@ +# 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 ._container_service_client import ContainerServiceClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_configuration.py new file mode 100644 index 000000000000..2469f9c26e94 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ContainerServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + :keyword api_version: Api Version. Default value is "2024-03-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", "2024-03-02-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_container_service_client.py new file mode 100644 index 000000000000..c634b6845d9f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_container_service_client.py @@ -0,0 +1,208 @@ +# 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 copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy + +from .. import models as _models +from ..._serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientConfiguration +from .operations import ( + AgentPoolsOperations, + LoadBalancersOperations, + MachinesOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + OperationStatusResultOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + ResolvePrivateLinkServiceIdOperations, + SnapshotsOperations, + TrustedAccessRoleBindingsOperations, + TrustedAccessRolesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.AgentPoolsOperations + :ivar machines: MachinesOperations operations + :vartype machines: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.MachinesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.ResolvePrivateLinkServiceIdOperations + :ivar operation_status_result: OperationStatusResultOperations operations + :vartype operation_status_result: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.OperationStatusResultOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.SnapshotsOperations + :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations + :vartype managed_cluster_snapshots: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.ManagedClusterSnapshotsOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.TrustedAccessRolesOperations + :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations + :vartype trusted_access_role_bindings: + azure.mgmt.containerservice.v2024_03_02_preview.aio.operations.TrustedAccessRoleBindingsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: + azure.mgmt.containerservice.v2024_03_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". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-03-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 + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + 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) + + 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, "2024-03-02-preview" + ) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.machines = MachinesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.operation_status_result = OperationStatusResultOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + self.load_balancers = LoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-03-02-preview" + ) + + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ContainerServiceClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_03_02_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..4400927248e5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/__init__.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._machines_operations import MachinesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._operation_status_result_operations import OperationStatusResultOperations +from ._snapshots_operations import SnapshotsOperations +from ._managed_cluster_snapshots_operations import ManagedClusterSnapshotsOperations +from ._trusted_access_roles_operations import TrustedAccessRolesOperations +from ._trusted_access_role_bindings_operations import TrustedAccessRoleBindingsOperations +from ._load_balancers_operations import LoadBalancersOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "MachinesOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "OperationStatusResultOperations", + "SnapshotsOperations", + "ManagedClusterSnapshotsOperations", + "TrustedAccessRolesOperations", + "TrustedAccessRoleBindingsOperations", + "LoadBalancersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..7896852d8323 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_agent_pools_operations.py @@ -0,0 +1,1189 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import ( + build_abort_latest_operation_request, + build_create_or_update_request, + build_delete_machines_request, + build_delete_request, + build_get_available_agent_pool_versions_request, + build_get_request, + build_get_upgrade_profile_request, + build_list_request, + build_upgrade_node_image_version_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class AgentPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`agent_pools` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Aborts last operation running on agent pool. + + Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + completes before cancellation can take place, an error is returned. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_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 "2024-03-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable["_models.AgentPool"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AgentPoolListResult", 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, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPool: + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :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 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.v2024_03_02_preview.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPool", pipeline_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, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentPool] = 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, "AgentPool") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AgentPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AgentPool", pipeline_response) + + 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, + agent_pool_name: str, + parameters: _models.AgentPool, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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.v2024_03_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 + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_03_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. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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, + agent_pool_name=agent_pool_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AgentPool", pipeline_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.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + @distributed_trace_async + async def get_upgrade_profile( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPoolUpgradeProfile: + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :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 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.v2024_03_02_preview.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_machines_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(machines, (IOBase, bytes)): + _content = machines + else: + _json = self._serialize.body(machines, "AgentPoolDeleteMachinesParameter") + + _request = build_delete_machines_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: _models.AgentPoolDeleteMachinesParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: + ~azure.mgmt.containerservice.v2024_03_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 + :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: + """ + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_03_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] + :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 "2024-03-02-preview") + ) + 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) + 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_machines_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machines=machines, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 + + @distributed_trace_async + async def get_available_agent_pool_versions( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.AgentPoolAvailableVersions: + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :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: AgentPoolAvailableVersions or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) + + _request = build_get_available_agent_pool_versions_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _upgrade_node_image_version_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Optional[_models.AgentPool]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[Optional[_models.AgentPool]] = kwargs.pop("cls", None) + + _request = build_upgrade_node_image_version_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_upgrade_node_image_version( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_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 "2024-03-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._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_load_balancers_operations.py new file mode 100644 index 000000000000..4e31a98a8947 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_load_balancers_operations.py @@ -0,0 +1,451 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union, cast +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._load_balancers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_managed_cluster_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class LoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`load_balancers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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.LoadBalancer"]: + """Gets a list of load balancers in the specified managed cluster. + + Gets a list of load balancers 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 LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", 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, load_balancer_name: str, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + Gets the specified load balancer. + + :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 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.v2024_03_02_preview.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + name: Optional[str] = None, + primary_agent_pool_name: Optional[str] = None, + allow_service_placement: Optional[bool] = None, + service_label_selector: Optional[_models.LabelSelector] = None, + service_namespace_selector: Optional[_models.LabelSelector] = None, + node_selector: Optional[_models.LabelSelector] = None, + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + Creates or updates a load balancer 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 load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param name: Name of the public load balancer. There will be an internal load balancer created + if needed, and the name will be ``-internal``. The internal lb shares the same + configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. There must be a name of kubernetes in the list. Default value is None. + :type name: str + :param 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 + agent pool can only be the primary pool for a single load balancer. Default value is None. + :type primary_agent_pool_name: str + :param allow_service_placement: Whether to automatically place services on the load balancer. + If not supplied, the default value is true. If set to false manually, both of the external and + the internal load balancer will not be selected for services unless they explicitly target it. + Default value is None. + :type allow_service_placement: bool + :param service_label_selector: Only services that must match this selector can be placed on + this load balancer. Default value is None. + :type service_label_selector: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.LabelSelector + :param service_namespace_selector: Services created in namespaces that match the selector can + be placed on this load balancer. Default value is None. + :type service_namespace_selector: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.LabelSelector + :param node_selector: Nodes that match this selector will be possible members of this load + balancer. Default value is None. + :type node_selector: ~azure.mgmt.containerservice.v2024_03_02_preview.models.LabelSelector + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _parameters = _models.LoadBalancer( + allow_service_placement=allow_service_placement, + name_properties_name=name, + node_selector=node_selector, + primary_agent_pool_name=primary_agent_pool_name, + service_label_selector=service_label_selector, + service_namespace_selector=service_namespace_selector, + ) + _json = self._serialize.body(_parameters, "LoadBalancer") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a load balancer in the specified managed cluster. + + Deletes a load balancer 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 load_balancer_name: The name of the load balancer. Required. + :type load_balancer_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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_machines_operations.py new file mode 100644 index 000000000000..6f21d4b5d6d8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_machines_operations.py @@ -0,0 +1,221 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._machines_operations import build_get_request, build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`machines` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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, agent_pool_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Machine"]: + """Gets a list of machines in the specified agent pool. + + Gets a list of machines in the specified agent pool. + + :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 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.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MachineListResult", 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, agent_pool_name: str, machine_name: str, **kwargs: Any + ) -> _models.Machine: + """Get a specific machine in the specified agent pool. + + Get a specific machine in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_03_02_preview.models.Machine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Machine", pipeline_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/v2024_03_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..1312d01de4b4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -0,0 +1,438 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_managed_cluster_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`maintenance_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations 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 MaintenanceConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationListResult", 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, config_name: str, **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration 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 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.v2024_03_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: _models.MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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.v2024_03_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.v2024_03_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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: 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: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: Union[_models.MaintenanceConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 config_name: The name of the maintenance configuration. Required. + :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.v2024_03_02_preview.models.MaintenanceConfiguration or IO[bytes] + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceConfiguration] = 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, "MaintenanceConfiguration") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :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 config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py new file mode 100644 index 000000000000..bb012ce25a8c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -0,0 +1,643 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._managed_cluster_snapshots_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ManagedClusterSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`managed_cluster_snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of managed cluster snapshots in the specified subscription. + + Gets a list of managed cluster snapshots in the specified subscription. + + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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 + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ManagedClusterSnapshot"]: + """Lists managed cluster snapshots in the specified subscription and resource group. + + Lists managed cluster snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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, **kwargs: Any) -> _models.ManagedClusterSnapshot: + """Gets a managed cluster snapshot. + + Gets a managed cluster snapshot. + + :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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterSnapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot to create or update. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterSnapshot, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 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.v2024_03_02_preview.models.ManagedClusterSnapshot or IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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, "ManagedClusterSnapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 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.v2024_03_02_preview.models.TagsObject or + IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a managed cluster snapshot. + + Deletes a managed cluster snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..f997cc05ea95 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,3472 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import ( + build_abort_latest_operation_request, + build_create_or_update_request, + build_delete_request, + build_get_access_profile_request, + build_get_command_result_request, + build_get_guardrails_versions_request, + build_get_mesh_revision_profile_request, + build_get_mesh_upgrade_profile_request, + build_get_os_options_request, + build_get_request, + build_get_safeguards_versions_request, + build_get_upgrade_profile_request, + build_list_by_resource_group_request, + build_list_cluster_admin_credentials_request, + build_list_cluster_monitoring_user_credentials_request, + build_list_cluster_user_credentials_request, + build_list_guardrails_versions_request, + build_list_kubernetes_versions_request, + build_list_mesh_revision_profiles_request, + build_list_mesh_upgrade_profiles_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_request, + build_list_safeguards_versions_request, + build_rebalance_load_balancers_request, + build_reset_aad_profile_request, + build_reset_service_principal_profile_request, + build_rotate_cluster_certificates_request, + build_rotate_service_account_signing_keys_request, + build_run_command_request, + build_start_request, + build_stop_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ManagedClustersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`managed_clusters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get_os_options( + self, location: str, resource_type: Optional[str] = None, **kwargs: Any + ) -> _models.OSOptionProfile: + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. Default + value is None. + :type resource_type: str + :return: OSOptionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.OSOptionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.OSOptionProfile] = kwargs.pop("cls", None) + + _request = build_get_os_options_request( + location=location, + subscription_id=self._config.subscription_id, + resource_type=resource_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OSOptionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: + """Gets a list of supported Kubernetes versions in the specified subscription. + + Contains extra metadata on the version, including supported patch versions, capabilities, + available upgrades, and details on preview status of the version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: KubernetesVersionListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.KubernetesVersionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) + + _request = build_list_kubernetes_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("KubernetesVersionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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 + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ManagedCluster"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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_upgrade_profile( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.ManagedClusterUpgradeProfile: + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile 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 + :return: ManagedClusterUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_access_profile( + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any + ) -> _models.ManagedClusterAccessProfile: + """Gets an access profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :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 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.v2024_03_02_preview.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) + + _request = build_get_access_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_admin_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials 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 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.v2024_03_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_admin_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any + ) -> _models.CredentialResults: + """Lists the user credentials of a managed cluster. + + Lists the user credentials 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :type server_fqdn: str + :param format: Only apply to AAD clusters, specifies the format of returned kubeconfig. Format + '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" and "exec". + Default value is None. + :type format: str or ~azure.mgmt.containerservice.v2024_03_02_preview.models.Format + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + format=format, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_monitoring_user_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials 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 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.v2024_03_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_monitoring_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: + """Gets a managed cluster. + + Gets 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 + :return: ManagedCluster or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_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, + parameters: Union[_models.ManagedCluster, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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, "ManagedCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + 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, + parameters: _models.ManagedCluster, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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 + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedCluster, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Is either a ManagedCluster type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + if_match: Optional[str] = None, + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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 + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 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.v2024_03_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. + :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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes 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 ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + async def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterServicePrincipalProfile") + + _request = build_reset_service_principal_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterServicePrincipalProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_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 + :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: + """ + + @overload + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 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.v2024_03_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] + :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 "2024-03-02-preview") + ) + 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) + 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._reset_service_principal_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterAADProfile") + + _request = build_reset_aad_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterAADProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_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 + :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: + """ + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 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.v2024_03_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: + """ + _headers = case_insensitive_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 "2024-03-02-preview") + ) + 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) + 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._reset_aad_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Aborts last operation running on managed cluster. + + Aborts the currently running operation on the managed cluster. The Managed Cluster will be + moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If + the operation completes before cancellation can take place, an error is returned. + + :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 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 "2024-03-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_cluster_certificates_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_rotate_cluster_certificates( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :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 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 "2024-03-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._rotate_cluster_certificates_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_service_account_signing_keys_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the service account signing keys of a managed cluster. + + Rotates the service account signing keys 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 + :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 "2024-03-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._rotate_service_account_signing_keys_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + 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 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 "2024-03-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._stop_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a 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 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 "2024-03-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._start_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_payload, (IOBase, bytes)): + _content = request_payload + else: + _json = self._serialize.body(request_payload, "RunCommandRequest") + + _request = build_run_command_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: _models.RunCommandRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: 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 RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Is either a RunCommandRequest type or a + IO[bytes] type. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RunCommandResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RunCommandResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RunCommandResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_command_result( + self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the 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 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.v2024_03_02_preview.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + _request = build_get_command_result_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpoint"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :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 OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_outbound_network_dependencies_endpoints_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", 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_guardrails_versions( + self, location: str, version: str, **kwargs: Any + ) -> _models.GuardrailsAvailableVersion: + """Gets supported Guardrails version in the specified subscription and location. + + Contains Guardrails version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: GuardrailsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.GuardrailsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_guardrails_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GuardrailsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_guardrails_versions( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.GuardrailsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either GuardrailsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_guardrails_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GuardrailsAvailableVersionsList", 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_safeguards_versions( + self, location: str, version: str, **kwargs: Any + ) -> _models.SafeguardsAvailableVersion: + """Gets supported Safeguards version in the specified subscription and location. + + Contains Safeguards version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: SafeguardsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SafeguardsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_safeguards_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SafeguardsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_safeguards_versions( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.SafeguardsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either SafeguardsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_safeguards_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SafeguardsAvailableVersionsList", 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 + def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIterable["_models.MeshRevisionProfile"]: + """Lists mesh revision profiles for all meshes in the specified location. + + Contains extra metadata on each revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_revision_profiles_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MeshRevisionProfileList", 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_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: + """Gets a mesh revision profile for a specified mesh in the specified location. + + Contains extra metadata on the revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshRevisionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshRevisionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_revision_profile_request( + location=location, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshRevisionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_upgrade_profiles( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterable["_models.MeshUpgradeProfile"]: + """Lists available upgrades for all service meshes in a specific cluster. + + Lists available upgrades for all service meshes in a specific 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 MeshUpgradeProfile or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_upgrade_profiles_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MeshUpgradeProfileList", 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_mesh_upgrade_profile( + self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any + ) -> _models.MeshUpgradeProfile: + """Gets available upgrades for a service mesh in a cluster. + + Gets available upgrades for a service mesh in a 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 mode: The mode of the mesh. Required. + :type mode: str + :return: MeshUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _rebalance_load_balancers_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "RebalanceLoadBalancersRequestBody") + + _request = build_rebalance_load_balancers_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.RebalanceLoadBalancersRequestBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 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.v2024_03_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 + :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: + """ + + @overload + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Is either a RebalanceLoadBalancersRequestBody type or a IO[bytes] + type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_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] + :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 "2024-03-02-preview") + ) + 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) + 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._rebalance_load_balancers_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_operation_status_result_operations.py new file mode 100644 index 000000000000..db0173577730 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_operation_status_result_operations.py @@ -0,0 +1,288 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operation_status_result_operations import ( + build_get_by_agent_pool_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OperationStatusResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`operation_status_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of operations in the specified managedCluster. + + Gets a list of operations in the specified managedCluster. + + :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 OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusResultList", 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, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified managed cluster. + + Get the status of a specific operation 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 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.v2024_03_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_by_agent_pool( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified agent pool. + + Get the status of a specific operation in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_03_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_by_agent_pool_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_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/v2024_03_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..81e43cd58bab --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_operations.py @@ -0,0 +1,139 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: + """Gets a list of operations. + + Gets a list of operations. + + :return: An iterator like instance of either OperationValue or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_03_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..0f12e4dbe907 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,456 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnectionListResult: + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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 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.v2024_03_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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.v2024_03_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.v2024_03_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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: 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: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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. Is either a + PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = 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, "PrivateEndpointConnection") + + _request = build_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..8f36d10e2880 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,120 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`private_link_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateLinkResourcesListResult: + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_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/v2024_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..2b4bd9293520 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,198 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ResolvePrivateLinkServiceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`resolve_private_link_service_id` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.PrivateLinkResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. 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: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.PrivateLinkResource, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 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.v2024_03_02_preview.models.PrivateLinkResource + or IO[bytes] + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkResource] = 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, "PrivateLinkResource") + + _request = build_post_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResource", pipeline_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/v2024_03_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..b080c11326a2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_snapshots_operations.py @@ -0,0 +1,635 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._snapshots_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: + """Gets a list of snapshots in the specified subscription. + + 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.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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 + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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, **kwargs: Any) -> _models.Snapshot: + """Gets a snapshot. + + Gets a snapshot. + + :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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.Snapshot, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot or IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Snapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 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.v2024_03_02_preview.models.TagsObject or + IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_trusted_access_role_bindings_operations.py new file mode 100644 index 000000000000..117f22cb17a5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -0,0 +1,554 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._trusted_access_role_bindings_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class TrustedAccessRoleBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`trusted_access_role_bindings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """List trusted access role bindings. + + List trusted access role bindings. + + :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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBindingListResult", 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, trusted_access_role_binding_name: str, **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + """Get a trusted access role binding. + + Get a trusted access role binding. + + :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 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.v2024_03_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(trusted_access_role_binding, (IOBase, bytes)): + _content = trusted_access_role_binding + else: + _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + 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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: _models.TrustedAccessRoleBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :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.v2024_03_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.v2024_03_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :param trusted_access_role_binding: A trusted access role binding. Required. + :type trusted_access_role_binding: 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 TrustedAccessRoleBinding or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :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.v2024_03_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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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, + trusted_access_role_binding_name=trusted_access_role_binding_name, + trusted_access_role_binding=trusted_access_role_binding, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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.TrustedAccessRoleBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TrustedAccessRoleBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a trusted access role binding. + + Delete a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_trusted_access_roles_operations.py new file mode 100644 index 000000000000..efdae209d034 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -0,0 +1,143 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._trusted_access_roles_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class TrustedAccessRolesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.aio.ContainerServiceClient`'s + :attr:`trusted_access_roles` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """List supported trusted access roles. + + List supported trusted access roles. + + :param location: The name of the Azure region. Required. + :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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleListResult", 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/__init__.py new file mode 100644 index 000000000000..674748cb32d5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/__init__.py @@ -0,0 +1,521 @@ +# 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 ._models_py3 import AbsoluteMonthlySchedule +from ._models_py3 import AdvancedNetworking +from ._models_py3 import AdvancedNetworkingObservability +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolArtifactStreamingProfile +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolDeleteMachinesParameter +from ._models_py3 import AgentPoolGPUProfile +from ._models_py3 import AgentPoolGatewayProfile +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolNetworkProfile +from ._models_py3 import AgentPoolSecurityProfile +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import AgentPoolWindowsProfile +from ._models_py3 import AzureKeyVaultKms +from ._models_py3 import CloudErrorBody +from ._models_py3 import ClusterUpgradeSettings +from ._models_py3 import CompatibleVersions +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceNetworkProfileKubeProxyConfig +from ._models_py3 import ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import CreationData +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import DailySchedule +from ._models_py3 import DateSpan +from ._models_py3 import DelegatedResource +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import ExtendedLocation +from ._models_py3 import GuardrailsAvailableVersion +from ._models_py3 import GuardrailsAvailableVersionsList +from ._models_py3 import GuardrailsAvailableVersionsProperties +from ._models_py3 import IPTag +from ._models_py3 import IstioCertificateAuthority +from ._models_py3 import IstioComponents +from ._models_py3 import IstioEgressGateway +from ._models_py3 import IstioIngressGateway +from ._models_py3 import IstioPluginCertificateAuthority +from ._models_py3 import IstioServiceMesh +from ._models_py3 import KubeletConfig +from ._models_py3 import KubernetesPatchVersion +from ._models_py3 import KubernetesVersion +from ._models_py3 import KubernetesVersionCapabilities +from ._models_py3 import KubernetesVersionListResult +from ._models_py3 import LabelSelector +from ._models_py3 import LabelSelectorRequirement +from ._models_py3 import LinuxOSConfig +from ._models_py3 import LoadBalancer +from ._models_py3 import LoadBalancerListResult +from ._models_py3 import Machine +from ._models_py3 import MachineIpAddress +from ._models_py3 import MachineListResult +from ._models_py3 import MachineNetworkProperties +from ._models_py3 import MachineProperties +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import MaintenanceWindow +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAIToolchainOperatorProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterAzureMonitorProfile +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoring +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics +from ._models_py3 import ManagedClusterAzureMonitorProfileContainerInsights +from ._models_py3 import ManagedClusterAzureMonitorProfileKubeStateMetrics +from ._models_py3 import ManagedClusterAzureMonitorProfileMetrics +from ._models_py3 import ManagedClusterBootstrapProfile +from ._models_py3 import ManagedClusterCostAnalysis +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterIngressProfile +from ._models_py3 import ManagedClusterIngressProfileWebAppRouting +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterManagedOutboundIPProfile +from ._models_py3 import ManagedClusterMetricsProfile +from ._models_py3 import ManagedClusterNATGatewayProfile +from ._models_py3 import ManagedClusterNodeProvisioningProfile +from ._models_py3 import ManagedClusterNodeResourceGroupProfile +from ._models_py3 import ManagedClusterOIDCIssuerProfile +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesForSnapshot +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterSecurityProfile +from ._models_py3 import ManagedClusterSecurityProfileDefender +from ._models_py3 import ManagedClusterSecurityProfileDefenderSecurityMonitoring +from ._models_py3 import ManagedClusterSecurityProfileImageCleaner +from ._models_py3 import ManagedClusterSecurityProfileImageIntegrity +from ._models_py3 import ManagedClusterSecurityProfileNodeRestriction +from ._models_py3 import ManagedClusterSecurityProfileWorkloadIdentity +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterSnapshot +from ._models_py3 import ManagedClusterSnapshotListResult +from ._models_py3 import ManagedClusterStaticEgressGatewayProfile +from ._models_py3 import ManagedClusterStorageProfile +from ._models_py3 import ManagedClusterStorageProfileBlobCSIDriver +from ._models_py3 import ManagedClusterStorageProfileDiskCSIDriver +from ._models_py3 import ManagedClusterStorageProfileFileCSIDriver +from ._models_py3 import ManagedClusterStorageProfileSnapshotController +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfile +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfileKeda +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler +from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue +from ._models_py3 import ManualScaleProfile +from ._models_py3 import MeshRevision +from ._models_py3 import MeshRevisionProfile +from ._models_py3 import MeshRevisionProfileList +from ._models_py3 import MeshRevisionProfileProperties +from ._models_py3 import MeshUpgradeProfile +from ._models_py3 import MeshUpgradeProfileList +from ._models_py3 import MeshUpgradeProfileProperties +from ._models_py3 import NetworkMonitoring +from ._models_py3 import NetworkProfileForSnapshot +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationStatusResult +from ._models_py3 import OperationStatusResultList +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PortRange +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import ProxyResource +from ._models_py3 import RebalanceLoadBalancersRequestBody +from ._models_py3 import RelativeMonthlySchedule +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import SafeguardsAvailableVersion +from ._models_py3 import SafeguardsAvailableVersionsList +from ._models_py3 import SafeguardsAvailableVersionsProperties +from ._models_py3 import SafeguardsProfile +from ._models_py3 import ScaleProfile +from ._models_py3 import Schedule +from ._models_py3 import ServiceMeshProfile +from ._models_py3 import Snapshot +from ._models_py3 import SnapshotListResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import TrackedResource +from ._models_py3 import TrustedAccessRole +from ._models_py3 import TrustedAccessRoleBinding +from ._models_py3 import TrustedAccessRoleBindingListResult +from ._models_py3 import TrustedAccessRoleListResult +from ._models_py3 import TrustedAccessRoleRule +from ._models_py3 import UpgradeOverrideSettings +from ._models_py3 import UserAssignedIdentity +from ._models_py3 import VirtualMachineNodes +from ._models_py3 import VirtualMachinesProfile +from ._models_py3 import WeeklySchedule +from ._models_py3 import WindowsGmsaProfile + +from ._container_service_client_enums import AddonAutoscaling +from ._container_service_client_enums import AgentPoolMode +from ._container_service_client_enums import AgentPoolSSHAccess +from ._container_service_client_enums import AgentPoolType +from ._container_service_client_enums import ArtifactSource +from ._container_service_client_enums import BackendPoolType +from ._container_service_client_enums import ClusterServiceLoadBalancerHealthProbeMode +from ._container_service_client_enums import Code +from ._container_service_client_enums import ConnectionStatus +from ._container_service_client_enums import CreatedByType +from ._container_service_client_enums import Expander +from ._container_service_client_enums import ExtendedLocationTypes +from ._container_service_client_enums import Format +from ._container_service_client_enums import GPUInstanceProfile +from ._container_service_client_enums import GuardrailsSupport +from ._container_service_client_enums import IpFamily +from ._container_service_client_enums import IpvsScheduler +from ._container_service_client_enums import IstioIngressGatewayMode +from ._container_service_client_enums import KeyVaultNetworkAccessTypes +from ._container_service_client_enums import KubeletDiskType +from ._container_service_client_enums import KubernetesSupportPlan +from ._container_service_client_enums import Level +from ._container_service_client_enums import LicenseType +from ._container_service_client_enums import LoadBalancerSku +from ._container_service_client_enums import ManagedClusterPodIdentityProvisioningState +from ._container_service_client_enums import ManagedClusterSKUName +from ._container_service_client_enums import ManagedClusterSKUTier +from ._container_service_client_enums import Mode +from ._container_service_client_enums import NetworkDataplane +from ._container_service_client_enums import NetworkMode +from ._container_service_client_enums import NetworkPlugin +from ._container_service_client_enums import NetworkPluginMode +from ._container_service_client_enums import NetworkPolicy +from ._container_service_client_enums import NodeOSUpgradeChannel +from ._container_service_client_enums import NodeProvisioningMode +from ._container_service_client_enums import OSDiskType +from ._container_service_client_enums import OSSKU +from ._container_service_client_enums import OSType +from ._container_service_client_enums import Operator +from ._container_service_client_enums import OutboundType +from ._container_service_client_enums import PodIPAllocationMode +from ._container_service_client_enums import PrivateEndpointConnectionProvisioningState +from ._container_service_client_enums import Protocol +from ._container_service_client_enums import PublicNetworkAccess +from ._container_service_client_enums import ResourceIdentityType +from ._container_service_client_enums import RestrictionLevel +from ._container_service_client_enums import SafeguardsSupport +from ._container_service_client_enums import ScaleDownMode +from ._container_service_client_enums import ScaleSetEvictionPolicy +from ._container_service_client_enums import ScaleSetPriority +from ._container_service_client_enums import ServiceMeshMode +from ._container_service_client_enums import SnapshotType +from ._container_service_client_enums import TrustedAccessRoleBindingProvisioningState +from ._container_service_client_enums import Type +from ._container_service_client_enums import UpgradeChannel +from ._container_service_client_enums import WeekDay +from ._container_service_client_enums import WorkloadRuntime +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AbsoluteMonthlySchedule", + "AdvancedNetworking", + "AdvancedNetworkingObservability", + "AgentPool", + "AgentPoolArtifactStreamingProfile", + "AgentPoolAvailableVersions", + "AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem", + "AgentPoolDeleteMachinesParameter", + "AgentPoolGPUProfile", + "AgentPoolGatewayProfile", + "AgentPoolListResult", + "AgentPoolNetworkProfile", + "AgentPoolSecurityProfile", + "AgentPoolUpgradeProfile", + "AgentPoolUpgradeProfilePropertiesUpgradesItem", + "AgentPoolUpgradeSettings", + "AgentPoolWindowsProfile", + "AzureKeyVaultKms", + "CloudErrorBody", + "ClusterUpgradeSettings", + "CompatibleVersions", + "ContainerServiceLinuxProfile", + "ContainerServiceNetworkProfile", + "ContainerServiceNetworkProfileKubeProxyConfig", + "ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig", + "ContainerServiceSshConfiguration", + "ContainerServiceSshPublicKey", + "CreationData", + "CredentialResult", + "CredentialResults", + "DailySchedule", + "DateSpan", + "DelegatedResource", + "EndpointDependency", + "EndpointDetail", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "ExtendedLocation", + "GuardrailsAvailableVersion", + "GuardrailsAvailableVersionsList", + "GuardrailsAvailableVersionsProperties", + "IPTag", + "IstioCertificateAuthority", + "IstioComponents", + "IstioEgressGateway", + "IstioIngressGateway", + "IstioPluginCertificateAuthority", + "IstioServiceMesh", + "KubeletConfig", + "KubernetesPatchVersion", + "KubernetesVersion", + "KubernetesVersionCapabilities", + "KubernetesVersionListResult", + "LabelSelector", + "LabelSelectorRequirement", + "LinuxOSConfig", + "LoadBalancer", + "LoadBalancerListResult", + "Machine", + "MachineIpAddress", + "MachineListResult", + "MachineNetworkProperties", + "MachineProperties", + "MaintenanceConfiguration", + "MaintenanceConfigurationListResult", + "MaintenanceWindow", + "ManagedCluster", + "ManagedClusterAADProfile", + "ManagedClusterAIToolchainOperatorProfile", + "ManagedClusterAPIServerAccessProfile", + "ManagedClusterAccessProfile", + "ManagedClusterAddonProfile", + "ManagedClusterAddonProfileIdentity", + "ManagedClusterAgentPoolProfile", + "ManagedClusterAgentPoolProfileProperties", + "ManagedClusterAutoUpgradeProfile", + "ManagedClusterAzureMonitorProfile", + "ManagedClusterAzureMonitorProfileAppMonitoring", + "ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation", + "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs", + "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics", + "ManagedClusterAzureMonitorProfileContainerInsights", + "ManagedClusterAzureMonitorProfileKubeStateMetrics", + "ManagedClusterAzureMonitorProfileMetrics", + "ManagedClusterBootstrapProfile", + "ManagedClusterCostAnalysis", + "ManagedClusterHTTPProxyConfig", + "ManagedClusterIdentity", + "ManagedClusterIngressProfile", + "ManagedClusterIngressProfileWebAppRouting", + "ManagedClusterListResult", + "ManagedClusterLoadBalancerProfile", + "ManagedClusterLoadBalancerProfileManagedOutboundIPs", + "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + "ManagedClusterLoadBalancerProfileOutboundIPs", + "ManagedClusterManagedOutboundIPProfile", + "ManagedClusterMetricsProfile", + "ManagedClusterNATGatewayProfile", + "ManagedClusterNodeProvisioningProfile", + "ManagedClusterNodeResourceGroupProfile", + "ManagedClusterOIDCIssuerProfile", + "ManagedClusterPodIdentity", + "ManagedClusterPodIdentityException", + "ManagedClusterPodIdentityProfile", + "ManagedClusterPodIdentityProvisioningError", + "ManagedClusterPodIdentityProvisioningErrorBody", + "ManagedClusterPodIdentityProvisioningInfo", + "ManagedClusterPoolUpgradeProfile", + "ManagedClusterPoolUpgradeProfileUpgradesItem", + "ManagedClusterPropertiesAutoScalerProfile", + "ManagedClusterPropertiesForSnapshot", + "ManagedClusterSKU", + "ManagedClusterSecurityProfile", + "ManagedClusterSecurityProfileDefender", + "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + "ManagedClusterSecurityProfileImageCleaner", + "ManagedClusterSecurityProfileImageIntegrity", + "ManagedClusterSecurityProfileNodeRestriction", + "ManagedClusterSecurityProfileWorkloadIdentity", + "ManagedClusterServicePrincipalProfile", + "ManagedClusterSnapshot", + "ManagedClusterSnapshotListResult", + "ManagedClusterStaticEgressGatewayProfile", + "ManagedClusterStorageProfile", + "ManagedClusterStorageProfileBlobCSIDriver", + "ManagedClusterStorageProfileDiskCSIDriver", + "ManagedClusterStorageProfileFileCSIDriver", + "ManagedClusterStorageProfileSnapshotController", + "ManagedClusterUpgradeProfile", + "ManagedClusterWindowsProfile", + "ManagedClusterWorkloadAutoScalerProfile", + "ManagedClusterWorkloadAutoScalerProfileKeda", + "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + "ManagedServiceIdentityUserAssignedIdentitiesValue", + "ManualScaleProfile", + "MeshRevision", + "MeshRevisionProfile", + "MeshRevisionProfileList", + "MeshRevisionProfileProperties", + "MeshUpgradeProfile", + "MeshUpgradeProfileList", + "MeshUpgradeProfileProperties", + "NetworkMonitoring", + "NetworkProfileForSnapshot", + "OSOptionProfile", + "OSOptionProperty", + "OperationListResult", + "OperationStatusResult", + "OperationStatusResultList", + "OperationValue", + "OutboundEnvironmentEndpoint", + "OutboundEnvironmentEndpointCollection", + "PortRange", + "PowerState", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourcesListResult", + "PrivateLinkServiceConnectionState", + "ProxyResource", + "RebalanceLoadBalancersRequestBody", + "RelativeMonthlySchedule", + "Resource", + "ResourceReference", + "RunCommandRequest", + "RunCommandResult", + "SafeguardsAvailableVersion", + "SafeguardsAvailableVersionsList", + "SafeguardsAvailableVersionsProperties", + "SafeguardsProfile", + "ScaleProfile", + "Schedule", + "ServiceMeshProfile", + "Snapshot", + "SnapshotListResult", + "SubResource", + "SysctlConfig", + "SystemData", + "TagsObject", + "TimeInWeek", + "TimeSpan", + "TrackedResource", + "TrustedAccessRole", + "TrustedAccessRoleBinding", + "TrustedAccessRoleBindingListResult", + "TrustedAccessRoleListResult", + "TrustedAccessRoleRule", + "UpgradeOverrideSettings", + "UserAssignedIdentity", + "VirtualMachineNodes", + "VirtualMachinesProfile", + "WeeklySchedule", + "WindowsGmsaProfile", + "AddonAutoscaling", + "AgentPoolMode", + "AgentPoolSSHAccess", + "AgentPoolType", + "ArtifactSource", + "BackendPoolType", + "ClusterServiceLoadBalancerHealthProbeMode", + "Code", + "ConnectionStatus", + "CreatedByType", + "Expander", + "ExtendedLocationTypes", + "Format", + "GPUInstanceProfile", + "GuardrailsSupport", + "IpFamily", + "IpvsScheduler", + "IstioIngressGatewayMode", + "KeyVaultNetworkAccessTypes", + "KubeletDiskType", + "KubernetesSupportPlan", + "Level", + "LicenseType", + "LoadBalancerSku", + "ManagedClusterPodIdentityProvisioningState", + "ManagedClusterSKUName", + "ManagedClusterSKUTier", + "Mode", + "NetworkDataplane", + "NetworkMode", + "NetworkPlugin", + "NetworkPluginMode", + "NetworkPolicy", + "NodeOSUpgradeChannel", + "NodeProvisioningMode", + "OSDiskType", + "OSSKU", + "OSType", + "Operator", + "OutboundType", + "PodIPAllocationMode", + "PrivateEndpointConnectionProvisioningState", + "Protocol", + "PublicNetworkAccess", + "ResourceIdentityType", + "RestrictionLevel", + "SafeguardsSupport", + "ScaleDownMode", + "ScaleSetEvictionPolicy", + "ScaleSetPriority", + "ServiceMeshMode", + "SnapshotType", + "TrustedAccessRoleBindingProvisioningState", + "Type", + "UpgradeChannel", + "WeekDay", + "WorkloadRuntime", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_container_service_client_enums.py new file mode 100644 index 000000000000..96757bf1d134 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_container_service_client_enums.py @@ -0,0 +1,725 @@ +# 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 enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AddonAutoscaling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.""" + + ENABLED = "Enabled" + """Feature to autoscale AKS-managed add-ons is enabled. The default VPA update mode is Initial + mode.""" + DISABLED = "Disabled" + """Feature to autoscale AKS-managed add-ons is disabled.""" + + +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: + https://docs.microsoft.com/azure/aks/use-system-pools. + """ + + SYSTEM = "System" + """System agent pools are primarily for hosting critical system pods such as CoreDNS and + metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at + least 2vCPUs and 4GB of memory.""" + USER = "User" + """User agent pools are primarily for hosting your application pods.""" + GATEWAY = "Gateway" + """Gateway agent pools are dedicated to providing static egress IPs to pods. For more details, see + https://aka.ms/aks/static-egress-gateway.""" + + +class AgentPoolSSHAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SSH access method of an agent pool.""" + + LOCAL_USER = "LocalUser" + """Can SSH onto the node as a local user using private key.""" + DISABLED = "Disabled" + """SSH service will be turned off on the node.""" + + +class AgentPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of Agent Pool.""" + + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + """Create an Agent Pool backed by a Virtual Machine Scale Set.""" + AVAILABILITY_SET = "AvailabilitySet" + """Use of this is strongly discouraged.""" + VIRTUAL_MACHINES = "VirtualMachines" + """Create an Agent Pool backed by a Single Instance VM orchestration mode.""" + + +class ArtifactSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The source where the artifacts are downloaded from.""" + + CACHE = "Cache" + """pull images from Azure Container Registry with cache""" + DIRECT = "Direct" + """pull images from Microsoft Artifact Registry""" + + +class BackendPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the managed inbound Load Balancer BackendPool.""" + + NODE_IP_CONFIGURATION = "NodeIPConfiguration" + """The type of the managed inbound Load Balancer BackendPool. + https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend.""" + NODE_IP = "NodeIP" + """The type of the managed inbound Load Balancer BackendPool. + https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend.""" + + +class ClusterServiceLoadBalancerHealthProbeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The health probing behavior for External Traffic Policy Cluster services.""" + + SERVICE_NODE_PORT = "ServiceNodePort" + """Each External Traffic Policy Cluster service will have its own health probe targeting service + nodePort.""" + SHARED = "Shared" + """All External Traffic Policy Cluster services in a Standard Load Balancer will have a dedicated + health probe targeting the backend nodes' kube-proxy health check port 10256.""" + + +class Code(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tells whether the cluster is Running or Stopped.""" + + RUNNING = "Running" + """The cluster is running.""" + STOPPED = "Stopped" + """The cluster is stopped.""" + + +class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The private link service connection status.""" + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class Expander(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """If not specified, the default is 'random'. See `expanders + `_ + for more information. + """ + + LEAST_WASTE = "least-waste" + """Selects the node group that will have the least idle CPU (if tied, unused memory) after + scale-up. This is useful when you have different classes of nodes, for example, high CPU or + high memory nodes, and only want to expand those when there are pending pods that need a lot of + those resources.""" + MOST_PODS = "most-pods" + """Selects the node group that would be able to schedule the most pods when scaling up. This is + useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note + that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple + smaller nodes at once.""" + PRIORITY = "priority" + """Selects the node group that has the highest priority assigned by the user. It's configuration + is described in more details `here + `_.""" + RANDOM = "random" + """Used when you don't have a particular need for the node groups to scale differently.""" + + +class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of extendedLocation.""" + + EDGE_ZONE = "EdgeZone" + + +class Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Format.""" + + AZURE = "azure" + """Return azure auth-provider kubeconfig. This format is deprecated in v1.22 and will be fully + removed in v1.26. See: https://aka.ms/k8s/changes-1-26.""" + EXEC_ENUM = "exec" + """Return exec format kubeconfig. This format requires kubelogin binary in the path.""" + + +class GPUInstanceProfile(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.""" + + MIG1_G = "MIG1g" + MIG2_G = "MIG2g" + MIG3_G = "MIG3g" + MIG4_G = "MIG4g" + MIG7_G = "MIG7g" + + +class GuardrailsSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the version is preview or stable.""" + + PREVIEW = "Preview" + """The version is preview. It is not recommended to use preview versions on critical production + clusters. The preview version may not support all use-cases.""" + STABLE = "Stable" + """The version is stable and can be used on critical production clusters.""" + + +class IpFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """To determine if address belongs IPv4 or IPv6 family.""" + + I_PV4 = "IPv4" + """IPv4 family""" + I_PV6 = "IPv6" + """IPv6 family""" + + +class IpvsScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. + """ + + ROUND_ROBIN = "RoundRobin" + """Round Robin""" + LEAST_CONNECTION = "LeastConnection" + """Least Connection""" + + +class IstioIngressGatewayMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mode of an ingress gateway.""" + + EXTERNAL = "External" + """The ingress gateway is assigned a public IP address and is publicly accessible.""" + INTERNAL = "Internal" + """The ingress gateway is assigned an internal IP address and cannot is accessed publicly.""" + + +class KeyVaultNetworkAccessTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network access of key vault. The possible values are ``Public`` and ``Private``. ``Public`` + means the key vault allows public access from all networks. ``Private`` means the key vault + disables public access and enables private link. The default value is ``Public``. + """ + + PUBLIC = "Public" + PRIVATE = "Private" + + +class KubeletDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet + ephemeral storage. + """ + + OS = "OS" + """Kubelet will use the OS disk for its data.""" + TEMPORARY = "Temporary" + """Kubelet will use the temporary disk for its data.""" + + +class KubernetesSupportPlan(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Different support tiers for AKS managed clusters.""" + + KUBERNETES_OFFICIAL = "KubernetesOfficial" + """Support for the version is the same as for the open source Kubernetes offering. Official + Kubernetes open source community support versions for 1 year after release.""" + AKS_LONG_TERM_SUPPORT = "AKSLongTermSupport" + """Support for the version extended past the KubernetesOfficial support of 1 year. AKS continues + to patch CVEs for another 1 year, for a total of 2 years of support.""" + + +class Level(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except + those that AKS excludes via systemExcludedNamespaces. + """ + + OFF = "Off" + WARNING = "Warning" + ENFORCEMENT = "Enforcement" + + +class LicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. + """ + + NONE = "None" + """No additional licensing is applied.""" + WINDOWS_SERVER = "Windows_Server" + """Enables Azure Hybrid User Benefits for Windows VMs.""" + + +class LoadBalancerSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. + """ + + STANDARD = "standard" + """Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information + about on working with the load balancer in the managed cluster, see the `standard Load Balancer + `_ article.""" + BASIC = "basic" + """Use a basic Load Balancer with limited functionality.""" + + +class ManagedClusterPodIdentityProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of the pod identity.""" + + ASSIGNED = "Assigned" + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + +class ManagedClusterSKUName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The name of a managed cluster SKU.""" + + BASE = "Base" + """Base option for the AKS control plane.""" + AUTOMATIC = "Automatic" + """Automatic clusters are optimized to run most production workloads with configuration that + follows AKS best practices and recommendations for cluster and workload setup, scalability, and + security. For more details about Automatic clusters see aka.ms/aks/automatic.""" + + +class ManagedClusterSKUTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """If not specified, the default is 'Free'. See `AKS Pricing Tier + `_ for more details. + """ + + PREMIUM = "Premium" + """Cluster has premium capabilities in addition to all of the capabilities included in 'Standard'. + Premium enables selection of LongTermSupport (aka.ms/aks/lts) for certain Kubernetes versions.""" + STANDARD = "Standard" + """Recommended for mission-critical and production workloads. Includes Kubernetes control plane + autoscaling, workload-intensive testing, and up to 5,000 nodes per cluster. Guarantees 99.95% + availability of the Kubernetes API server endpoint for clusters that use Availability Zones and + 99.9% of availability for clusters that don't use Availability Zones.""" + FREE = "Free" + """The cluster management is free, but charged for VM, storage, and networking usage. Best for + experimenting, learning, simple testing, or workloads with fewer than 10 nodes. Not recommended + for production use cases.""" + + +class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify which proxy mode to use ('IPTABLES' or 'IPVS').""" + + IPTABLES = "IPTABLES" + """IPTables proxy mode""" + IPVS = "IPVS" + """IPVS proxy mode. Must be using Kubernetes version >= 1.22.""" + + +class NetworkDataplane(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network dataplane used in the Kubernetes cluster.""" + + AZURE = "azure" + """Use Azure network dataplane.""" + CILIUM = "cilium" + """Use Cilium network dataplane. See `Azure CNI Powered by Cilium + `_ for more information.""" + + +class NetworkMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This cannot be specified if networkPlugin is anything other than 'azure'.""" + + TRANSPARENT = "transparent" + """No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure + CNI. See `Transparent Mode `_ for + more information.""" + BRIDGE = "bridge" + """This is no longer supported""" + + +class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network plugin used for building the Kubernetes network.""" + + AZURE = "azure" + """Use the Azure CNI network plugin. See `Azure CNI (advanced) networking + `_ for + more information.""" + KUBENET = "kubenet" + """Use the Kubenet network plugin. See `Kubenet (basic) networking + `_ for more + information.""" + NONE = "none" + """Do not use a network plugin. A custom CNI will need to be installed after cluster creation for + networking functionality.""" + + +class NetworkPluginMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The mode the network plugin should use.""" + + OVERLAY = "overlay" + """Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than + Kubenet reference plugins host-local and bridge.""" + + +class NetworkPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network policy used for building the Kubernetes network.""" + + NONE = "none" + """Network policies will not be enforced. This is the default value when NetworkPolicy is not + specified.""" + CALICO = "calico" + """Use Calico network policies. See `differences between Azure and Calico policies + `_ + for more information.""" + AZURE = "azure" + """Use Azure network policies. See `differences between Azure and Calico policies + `_ + for more information.""" + CILIUM = "cilium" + """Use Cilium to enforce network policies. This requires networkDataplane to be 'cilium'.""" + + +class NodeOSUpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA.""" + + NONE = "None" + """No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means + you are responsible for your security updates""" + UNMANAGED = "Unmanaged" + """OS updates will be applied automatically through the OS built-in patching infrastructure. Newly + scaled in machines will be unpatched initially, and will be patched at some later time by the + OS's infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner + apply security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows + does not apply security patches automatically and so for them this option is equivalent to None + till further notice""" + SECURITY_PATCH = "SecurityPatch" + """AKS will update the nodes VHD with patches from the image maintainer labelled "security only" + on a regular basis. Where possible, patches will also be applied without reimaging to existing + nodes. Some patches, such as kernel patches, cannot be applied to existing nodes without + disruption. For such patches, the VHD will be updated, and machines will be rolling reimaged to + that VHD following maintenance windows and surge settings. This option incurs the extra cost of + hosting the VHDs in your node resource group.""" + NODE_IMAGE = "NodeImage" + """AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a + weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following + maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option + as AKS hosts the images.""" + + +class NodeProvisioningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Once the mode it set to Auto, it cannot be changed back to Manual.""" + + MANUAL = "Manual" + """Nodes are provisioned manually by the user""" + AUTO = "Auto" + """Nodes are provisioned automatically by AKS using Karpenter. Fixed size Node Pools can still be + created, but autoscaling Node Pools cannot be. (See aka.ms/aks/nap for more details).""" + + +class Operator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """operator represents a key's relationship to a set of values. Valid operators are In and NotIn.""" + + IN_ENUM = "In" + """The value of the key should be in the given list.""" + NOT_IN = "NotIn" + """The value of the key should not be in the given list.""" + EXISTS = "Exists" + """The value of the key should exist.""" + DOES_NOT_EXIST = "DoesNotExist" + """The value of the key should not exist.""" + + +class OSDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """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 + `_. + """ + + MANAGED = "Managed" + """Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data + loss should the VM need to be relocated to another host. Since containers aren't designed to + have local state persisted, this behavior offers limited value while providing some drawbacks, + including slower node provisioning and higher read/write latency.""" + EPHEMERAL = "Ephemeral" + """Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This + provides lower read/write latency, along with faster node scaling and cluster upgrades.""" + + +class OSSKU(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """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. + """ + + UBUNTU = "Ubuntu" + """Use Ubuntu as the OS for node images.""" + MARINER = "Mariner" + """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" + AZURE_LINUX = "AzureLinux" + """Use AzureLinux as the OS for node images. Azure Linux is a container-optimized Linux distro + built by Microsoft, visit https://aka.ms/azurelinux for more information.""" + CBL_MARINER = "CBLMariner" + """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" + WINDOWS2019 = "Windows2019" + """Use Windows2019 as the OS for node images. Unsupported for system node pools. Windows2019 only + supports Windows2019 containers; it cannot run Windows2022 containers and vice versa.""" + 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.""" + WINDOWS_ANNUAL = "WindowsAnnual" + """Use Windows Annual Channel version as the OS for node images. Unsupported for system node + pools. Details about supported container images and kubernetes versions under different AKS + Annual Channel versions could be seen in https://aka.ms/aks/windows-annual-channel-details.""" + + +class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operating system type. The default is Linux.""" + + LINUX = "Linux" + """Use Linux.""" + WINDOWS = "Windows" + """Use Windows.""" + + +class OutboundType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This can only be set at cluster creation time and cannot be changed later. For more information + see `egress outbound type `_. + """ + + LOAD_BALANCER = "loadBalancer" + """The load balancer is used for egress through an AKS assigned public IP. This supports + Kubernetes services of type 'loadBalancer'. For more information see `outbound type + loadbalancer + `_.""" + USER_DEFINED_ROUTING = "userDefinedRouting" + """Egress paths must be defined by the user. This is an advanced scenario and requires proper + network configuration. For more information see `outbound type userDefinedRouting + `_.""" + MANAGED_NAT_GATEWAY = "managedNATGateway" + """The AKS-managed NAT gateway is used for egress.""" + USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" + """The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an + advanced scenario and requires proper network configuration.""" + + +class PodIPAllocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default + is 'DynamicIndividual'. + """ + + DYNAMIC_INDIVIDUAL = "DynamicIndividual" + """Each pod gets a single IP address assigned. This is better for maximizing a small to medium + subnet of size /16 or smaller. The Azure CNI cluster with dynamic IP allocation defaults to + this mode if the customer does not explicitly specify a podIPAllocationMode""" + STATIC_BLOCK = "StaticBlock" + """Each node is statically allocated CIDR block(s) of size /28 = 16 IPs per block to satisfy the + maxPods per node. Number of CIDR blocks >= (maxPods / 16). The block, rather than a single IP, + counts against the Azure Vnet Private IP limit of 65K. Therefore block mode is suitable for + running larger workloads with more than the current limit of 65K pods in a cluster. This mode + is better suited to scale with larger subnets of /15 or bigger""" + + +class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + CANCELED = "Canceled" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + +class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The network protocol of the port.""" + + TCP = "TCP" + """TCP protocol.""" + UDP = "UDP" + """UDP protocol.""" + + +class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allow or deny public network access for AKS.""" + + ENABLED = "Enabled" + """Inbound/Outbound to the managedCluster is allowed.""" + DISABLED = "Disabled" + """Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed.""" + SECURED_BY_PERIMETER = "SecuredByPerimeter" + """Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters.""" + + +class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """For more information see `use managed identities in AKS + `_. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + """Use an implicitly created system assigned managed identity to manage cluster resources. Master + components in the control plane such as kube-controller-manager will use the system assigned + managed identity to manipulate Azure resources.""" + USER_ASSIGNED = "UserAssigned" + """Use a user-specified identity to manage cluster resources. Master components in the control + plane such as kube-controller-manager will use the specified user assigned managed identity to + manipulate Azure resources.""" + NONE = "None" + """Do not use a managed identity for the Managed Cluster, service principal will be used instead.""" + + +class RestrictionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The restriction level applied to the cluster's node resource group.""" + + UNRESTRICTED = "Unrestricted" + """All RBAC permissions are allowed on the managed node resource group""" + READ_ONLY = "ReadOnly" + """Only */read RBAC permissions allowed on the managed node resource group""" + + +class SafeguardsSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the version is preview or stable.""" + + PREVIEW = "Preview" + """The version is preview. It is not recommended to use preview versions on critical production + clusters. The preview version may not support all use-cases.""" + STABLE = "Stable" + """The version is stable and can be used on critical production clusters.""" + + +class ScaleDownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes how VMs are added to or removed from Agent Pools. See `billing states + `_. + """ + + DELETE = "Delete" + """Create new instances during scale up and remove instances during scale down.""" + DEALLOCATE = "Deallocate" + """Attempt to start deallocated instances (if they exist) during scale up and deallocate instances + during scale down.""" + + +class ScaleSetEvictionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. + For more information about eviction see `spot VMs + `_. + """ + + DELETE = "Delete" + """Nodes in the underlying Scale Set of the node pool are deleted when they're evicted.""" + DEALLOCATE = "Deallocate" + """Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state + upon eviction. Nodes in the stopped-deallocated state count against your compute quota and can + cause issues with cluster scaling or upgrading.""" + + +class ScaleSetPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Virtual Machine Scale Set priority.""" + + SPOT = "Spot" + """Spot priority VMs will be used. There is no SLA for spot nodes. See `spot on AKS + `_ for more information.""" + REGULAR = "Regular" + """Regular VMs will be used.""" + + +class ServiceMeshMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mode of the service mesh.""" + + ISTIO = "Istio" + """Istio deployed as an AKS addon.""" + DISABLED = "Disabled" + """Mesh is disabled.""" + + +class SnapshotType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a snapshot. The default is NodePool.""" + + NODE_POOL = "NodePool" + """The snapshot is a snapshot of a node pool.""" + MANAGED_CLUSTER = "ManagedCluster" + """The snapshot is a snapshot of a managed cluster.""" + + +class TrustedAccessRoleBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of trusted access role binding.""" + + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + +class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.""" + + FIRST = "First" + """First.""" + SECOND = "Second" + """Second.""" + THIRD = "Third" + """Third.""" + FOURTH = "Fourth" + """Fourth.""" + LAST = "Last" + """Last.""" + + +class UpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """For more information see `setting the AKS cluster auto-upgrade channel + `_. + """ + + RAPID = "rapid" + """Automatically upgrade the cluster to the latest supported patch release on the latest supported + minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor + version where N is the latest supported minor version, the cluster first upgrades to the latest + supported patch version on N-1 minor version. For example, if a cluster is running version + 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is + upgraded to 1.18.6, then is upgraded to 1.19.1.""" + STABLE = "stable" + """Automatically upgrade the cluster to the latest supported patch release on minor version N-1, + where N is the latest supported minor version. For example, if a cluster is running version + 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded + to 1.18.6.""" + PATCH = "patch" + """Automatically upgrade the cluster to the latest supported patch version when it becomes + available while keeping the minor version the same. For example, if a cluster is running + version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is + upgraded to 1.17.9.""" + NODE_IMAGE = "node-image" + """Automatically upgrade the node image to the latest version available. Consider using + nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from + Kubernetes version patching""" + NONE = "none" + """Disables auto-upgrades and keeps the cluster at its current version of Kubernetes.""" + + +class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The weekday enum.""" + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + + +class WorkloadRuntime(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Determines the type of workload a node can run.""" + + OCI_CONTAINER = "OCIContainer" + """Nodes will use Kubelet to run standard OCI container workloads.""" + WASM_WASI = "WasmWasi" + """Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview).""" + KATA_MSHV_VM_ISOLATION = "KataMshvVmIsolation" + """Nodes can use (Kata + Cloud Hypervisor + Hyper-V) to enable Nested VM-based pods (Preview). Due + to the use Hyper-V, AKS node OS itself is a nested VM (the root OS) of Hyper-V. Thus it can + only be used with VM series that support Nested Virtualization such as Dv3 series.""" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_models_py3.py new file mode 100644 index 000000000000..db5fe994674b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_models_py3.py @@ -0,0 +1,10671 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union + +from ... import _serialization + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AbsoluteMonthlySchedule(_serialization.Model): + """For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + + All required parameters must be populated in order to send to server. + + :ivar interval_months: Specifies the number of months between each set of occurrences. + Required. + :vartype interval_months: int + :ivar day_of_month: The date of the month. Required. + :vartype day_of_month: int + """ + + _validation = { + "interval_months": {"required": True, "maximum": 6, "minimum": 1}, + "day_of_month": {"required": True, "maximum": 31, "minimum": 1}, + } + + _attribute_map = { + "interval_months": {"key": "intervalMonths", "type": "int"}, + "day_of_month": {"key": "dayOfMonth", "type": "int"}, + } + + def __init__(self, *, interval_months: int, day_of_month: int, **kwargs: Any) -> None: + """ + :keyword interval_months: Specifies the number of months between each set of occurrences. + Required. + :paramtype interval_months: int + :keyword day_of_month: The date of the month. Required. + :paramtype day_of_month: int + """ + super().__init__(**kwargs) + self.interval_months = interval_months + self.day_of_month = day_of_month + + +class AdvancedNetworking(_serialization.Model): + """Advanced Networking profile for enabling observability on a cluster. For more information see + aka.ms/aksadvancednetworking. + + :ivar observability: Observability profile to enable advanced network metrics and flow logs + with historical contexts. + :vartype observability: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AdvancedNetworkingObservability + """ + + _attribute_map = { + "observability": {"key": "observability", "type": "AdvancedNetworkingObservability"}, + } + + def __init__( + self, *, observability: Optional["_models.AdvancedNetworkingObservability"] = None, **kwargs: Any + ) -> None: + """ + :keyword observability: Observability profile to enable advanced network metrics and flow logs + with historical contexts. + :paramtype observability: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AdvancedNetworkingObservability + """ + super().__init__(**kwargs) + self.observability = observability + + +class AdvancedNetworkingObservability(_serialization.Model): + """Observability profile to enable advanced network metrics and flow logs with historical + contexts. + + :ivar enabled: Indicates the enablement of Advanced Networking observability functionalities on + clusters. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates the enablement of Advanced Networking observability functionalities + on clusters. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class SubResource(_serialization.Model): + """Reference to another subresource. + + 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 + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgentPool(SubResource): # pylint: disable=too-many-instance-attributes + """Agent Pool. + + 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 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_03_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.v2024_03_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.v2024_03_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_03_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.v2024_03_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.v2024_03_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_03_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.v2024_03_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.v2024_03_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_03_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.v2024_03_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_03_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_03_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_03_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.v2024_03_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 + 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.v2024_03_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.AgentPoolGatewayProfile + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "e_tag": {"readonly": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "e_tag": {"key": "properties.eTag", "type": "str"}, + "count": {"key": "properties.count", "type": "int"}, + "vm_size": {"key": "properties.vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "properties.osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "properties.osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "properties.kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "properties.workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "properties.messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "properties.vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "properties.podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "properties.podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "properties.maxPods", "type": "int"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "os_sku": {"key": "properties.osSKU", "type": "str"}, + "max_count": {"key": "properties.maxCount", "type": "int"}, + "min_count": {"key": "properties.minCount", "type": "int"}, + "enable_auto_scaling": {"key": "properties.enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "properties.scaleDownMode", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "mode": {"key": "properties.mode", "type": "str"}, + "orchestrator_version": {"key": "properties.orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "properties.currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "properties.nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "properties.upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "power_state": {"key": "properties.powerState", "type": "PowerState"}, + "availability_zones": {"key": "properties.availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "properties.enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "properties.enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "properties.nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "properties.scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "properties.scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "properties.spotMaxPrice", "type": "float"}, + "tags": {"key": "properties.tags", "type": "{str}"}, + "node_labels": {"key": "properties.nodeLabels", "type": "{str}"}, + "node_taints": {"key": "properties.nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "properties.nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "properties.proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "properties.kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "properties.linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "properties.enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "properties.enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "properties.enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "properties.gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "properties.capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "properties.hostGroupID", "type": "str"}, + "windows_profile": {"key": "properties.windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "properties.networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "properties.securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "properties.gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": { + "key": "properties.artifactStreamingProfile", + "type": "AgentPoolArtifactStreamingProfile", + }, + "virtual_machines_profile": {"key": "properties.virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": { + "key": "properties.virtualMachineNodesStatus", + "type": "[VirtualMachineNodes]", + }, + "gateway_profile": {"key": "properties.gatewayProfile", "type": "AgentPoolGatewayProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type_properties_type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_03_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.v2024_03_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.v2024_03_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_03_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.v2024_03_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.v2024_03_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_03_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.v2024_03_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.v2024_03_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_03_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.v2024_03_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_03_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_03_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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 + 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.v2024_03_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.AgentPoolGatewayProfile + """ + super().__init__(**kwargs) + self.e_tag = None + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.message_of_the_day = message_of_the_day + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.pod_ip_allocation_mode = pod_ip_allocation_mode + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + 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.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = power_state + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.enable_custom_ca_trust = enable_custom_ca_trust + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.node_initialization_taints = node_initialization_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + self.capacity_reservation_group_id = capacity_reservation_group_id + self.host_group_id = host_group_id + self.windows_profile = windows_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.gpu_profile = gpu_profile + self.artifact_streaming_profile = artifact_streaming_profile + self.virtual_machines_profile = virtual_machines_profile + self.virtual_machine_nodes_status = virtual_machine_nodes_status + self.gateway_profile = gateway_profile + + +class AgentPoolArtifactStreamingProfile(_serialization.Model): + """AgentPoolArtifactStreamingProfile. + + :ivar enabled: Artifact streaming speeds up the cold-start of containers on a node through + on-demand image loading. To use this feature, container images must also enable artifact + streaming on ACR. If not specified, the default is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Artifact streaming speeds up the cold-start of containers on a node through + on-demand image loading. To use this feature, container images must also enable artifact + streaming on ACR. If not specified, the default is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class AgentPoolAvailableVersions(_serialization.Model): + """The list of available versions for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the agent pool version list. + :vartype id: str + :ivar name: The name of the agent pool version list. + :vartype name: str + :ivar type: Type of the agent pool version list. + :vartype type: str + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] # pylint: disable=line-too-long + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "agent_pool_versions": { + "key": "properties.agentPoolVersions", + "type": "[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]", + }, + } + + def __init__( + self, + *, + agent_pool_versions: Optional[List["_models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.agent_pool_versions = agent_pool_versions + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(_serialization.Model): # pylint: disable=name-too-long + """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "default": {"key": "default", "type": "bool"}, + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.default = default + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolDeleteMachinesParameter(_serialization.Model): + """Specifies a list of machine names from the agent pool to be deleted. + + All required parameters must be populated in order to send to server. + + :ivar machine_names: The agent pool machine names. Required. + :vartype machine_names: list[str] + """ + + _validation = { + "machine_names": {"required": True}, + } + + _attribute_map = { + "machine_names": {"key": "machineNames", "type": "[str]"}, + } + + def __init__(self, *, machine_names: List[str], **kwargs: Any) -> None: + """ + :keyword machine_names: The agent pool machine names. Required. + :paramtype machine_names: list[str] + """ + super().__init__(**kwargs) + self.machine_names = machine_names + + +class AgentPoolGatewayProfile(_serialization.Model): + """Profile of the managed cluster gateway agent pool. + + :ivar public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each + static egress gateway to provide public egress. The size of Public IPPrefix should be selected + by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The + IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public + IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 + nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + :vartype public_ip_prefix_size: int + """ + + _validation = { + "public_ip_prefix_size": {"maximum": 31, "minimum": 28}, + } + + _attribute_map = { + "public_ip_prefix_size": {"key": "publicIPPrefixSize", "type": "int"}, + } + + def __init__(self, *, public_ip_prefix_size: int = 31, **kwargs: Any) -> None: + """ + :keyword public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each + static egress gateway to provide public egress. The size of Public IPPrefix should be selected + by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The + IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public + IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 + nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + :paramtype public_ip_prefix_size: int + """ + super().__init__(**kwargs) + self.public_ip_prefix_size = public_ip_prefix_size + + +class AgentPoolGPUProfile(_serialization.Model): + """AgentPoolGPUProfile. + + :ivar install_gpu_driver: The default value is true when the vmSize of the agent pool contains + a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated + GPU resource. Setting this field to false prevents automatic GPU driver installation. In that + case, in order for the GPU to be usable, the user must perform GPU driver installation + themselves. + :vartype install_gpu_driver: bool + """ + + _attribute_map = { + "install_gpu_driver": {"key": "installGPUDriver", "type": "bool"}, + } + + def __init__(self, *, install_gpu_driver: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword install_gpu_driver: The default value is true when the vmSize of the agent pool + contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an + associated GPU resource. Setting this field to false prevents automatic GPU driver + installation. In that case, in order for the GPU to be usable, the user must perform GPU driver + installation themselves. + :paramtype install_gpu_driver: bool + """ + super().__init__(**kwargs) + self.install_gpu_driver = install_gpu_driver + + +class AgentPoolListResult(_serialization.Model): + """The response from the List Agent Pools operation. + + 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.v2024_03_02_preview.models.AgentPool] + :ivar next_link: The URL to get the next set of agent pool results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AgentPool]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_03_02_preview.models.AgentPool] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = 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.v2024_03_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.v2024_03_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] + """ + + _attribute_map = { + "node_public_ip_tags": {"key": "nodePublicIPTags", "type": "[IPTag]"}, + "allowed_host_ports": {"key": "allowedHostPorts", "type": "[PortRange]"}, + "application_security_groups": {"key": "applicationSecurityGroups", "type": "[str]"}, + } + + def __init__( + self, + *, + node_public_ip_tags: Optional[List["_models.IPTag"]] = None, + allowed_host_ports: Optional[List["_models.PortRange"]] = None, + application_security_groups: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword node_public_ip_tags: IPTags of instance-level public IPs. + :paramtype node_public_ip_tags: + list[~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + """ + super().__init__(**kwargs) + self.node_public_ip_tags = node_public_ip_tags + self.allowed_host_ports = allowed_host_ports + self.application_security_groups = application_security_groups + + +class AgentPoolSecurityProfile(_serialization.Model): + """The security settings of an agent pool. + + :ivar ssh_access: SSH access method of an agent pool. Known values are: "LocalUser" and + "Disabled". + :vartype ssh_access: str or + ~azure.mgmt.containerservice.v2024_03_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. + :vartype enable_vtpm: bool + :ivar enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only + signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. + If not specified, the default is false. + :vartype enable_secure_boot: bool + """ + + _attribute_map = { + "ssh_access": {"key": "sshAccess", "type": "str"}, + "enable_vtpm": {"key": "enableVTPM", "type": "bool"}, + "enable_secure_boot": {"key": "enableSecureBoot", "type": "bool"}, + } + + def __init__( + self, + *, + ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = None, + enable_vtpm: Optional[bool] = None, + enable_secure_boot: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword ssh_access: SSH access method of an agent pool. Known values are: "LocalUser" and + "Disabled". + :paramtype ssh_access: str or + ~azure.mgmt.containerservice.v2024_03_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. + :paramtype enable_vtpm: bool + :keyword enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only + signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. + If not specified, the default is false. + :paramtype enable_secure_boot: bool + """ + super().__init__(**kwargs) + self.ssh_access = ssh_access + self.enable_vtpm = enable_vtpm + self.enable_secure_boot = enable_secure_boot + + +class AgentPoolUpgradeProfile(_serialization.Model): + """The list of available upgrades for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the agent pool upgrade profile. + :vartype id: str + :ivar name: The name of the agent pool upgrade profile. + :vartype name: str + :ivar type: The type of the agent pool upgrade profile. + :vartype type: str + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :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.v2024_03_02_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "kubernetes_version": {"required": True}, + "os_type": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "upgrades": {"key": "properties.upgrades", "type": "[AgentPoolUpgradeProfilePropertiesUpgradesItem]"}, + "latest_node_image_version": {"key": "properties.latestNodeImageVersion", "type": "str"}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "_models.OSType"] = "Linux", + upgrades: Optional[List["_models.AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + latest_node_image_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :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.v2024_03_02_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2024_03_02_preview.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.kubernetes_version = kubernetes_version + self.os_type = os_type + self.upgrades = upgrades + self.latest_node_image_version = latest_node_image_version + + +class AgentPoolUpgradeProfilePropertiesUpgradesItem(_serialization.Model): # pylint: disable=name-too-long + """AgentPoolUpgradeProfilePropertiesUpgradesItem. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, *, kubernetes_version: Optional[str] = None, is_preview: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolUpgradeSettings(_serialization.Model): + """Settings for upgrading an agentpool. + + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '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 + 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :vartype max_surge: 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 + minutes. + :vartype drain_timeout_in_minutes: int + :ivar node_soak_duration_in_minutes: The amount of time (in minutes) to wait after draining a + 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 + """ + + _validation = { + "drain_timeout_in_minutes": {"maximum": 1440, "minimum": 1}, + "node_soak_duration_in_minutes": {"maximum": 30, "minimum": 0}, + } + + _attribute_map = { + "max_surge": {"key": "maxSurge", "type": "str"}, + "drain_timeout_in_minutes": {"key": "drainTimeoutInMinutes", "type": "int"}, + "node_soak_duration_in_minutes": {"key": "nodeSoakDurationInMinutes", "type": "int"}, + } + + def __init__( + self, + *, + max_surge: Optional[str] = None, + drain_timeout_in_minutes: Optional[int] = None, + node_soak_duration_in_minutes: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '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 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: 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 + minutes. + :paramtype drain_timeout_in_minutes: int + :keyword node_soak_duration_in_minutes: The amount of time (in minutes) to wait after draining + 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 + """ + super().__init__(**kwargs) + self.max_surge = max_surge + self.drain_timeout_in_minutes = drain_timeout_in_minutes + self.node_soak_duration_in_minutes = node_soak_duration_in_minutes + + +class AgentPoolWindowsProfile(_serialization.Model): + """The Windows agent pool's specific profile. + + :ivar disable_outbound_nat: The default value is false. Outbound NAT can only be disabled if + the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP + enabled. + :vartype disable_outbound_nat: bool + """ + + _attribute_map = { + "disable_outbound_nat": {"key": "disableOutboundNat", "type": "bool"}, + } + + def __init__(self, *, disable_outbound_nat: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword disable_outbound_nat: The default value is false. Outbound NAT can only be disabled if + the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP + enabled. + :paramtype disable_outbound_nat: bool + """ + super().__init__(**kwargs) + self.disable_outbound_nat = disable_outbound_nat + + +class AzureKeyVaultKms(_serialization.Model): + """Azure Key Vault key management service settings for the security profile. + + :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. + :vartype key_id: str + :ivar key_vault_network_access: Network access of key vault. The possible values are ``Public`` + and ``Private``. ``Public`` means the key vault allows public access from all networks. + ``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.v2024_03_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. + :vartype key_vault_resource_id: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "key_id": {"key": "keyId", "type": "str"}, + "key_vault_network_access": {"key": "keyVaultNetworkAccess", "type": "str"}, + "key_vault_resource_id": {"key": "keyVaultResourceId", "type": "str"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + key_id: Optional[str] = None, + key_vault_network_access: Union[str, "_models.KeyVaultNetworkAccessTypes"] = "Public", + key_vault_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable Azure Key Vault key management service. The default is + 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. + :paramtype key_id: str + :keyword key_vault_network_access: Network access of key vault. The possible values are + ``Public`` and ``Private``. ``Public`` means the key vault allows public access from all + 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.v2024_03_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. + :paramtype key_vault_resource_id: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.key_id = key_id + self.key_vault_network_access = key_vault_network_access + self.key_vault_resource_id = key_vault_resource_id + + +class CloudErrorBody(_serialization.Model): + """An error response from the Container service. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2024_03_02_preview.models.CloudErrorBody] + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[CloudErrorBody]"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.CloudErrorBody"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.CloudErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ClusterUpgradeSettings(_serialization.Model): + """Settings for upgrading a cluster. + + :ivar override_settings: Settings for overrides. + :vartype override_settings: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.UpgradeOverrideSettings + """ + + _attribute_map = { + "override_settings": {"key": "overrideSettings", "type": "UpgradeOverrideSettings"}, + } + + def __init__(self, *, override_settings: Optional["_models.UpgradeOverrideSettings"] = None, **kwargs: Any) -> None: + """ + :keyword override_settings: Settings for overrides. + :paramtype override_settings: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.UpgradeOverrideSettings + """ + super().__init__(**kwargs) + self.override_settings = override_settings + + +class CompatibleVersions(_serialization.Model): + """Version information about a product/service that is compatible with a service mesh revision. + + :ivar name: The product/service name. + :vartype name: str + :ivar versions: Product/service versions compatible with a service mesh add-on revision. + :vartype versions: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "versions": {"key": "versions", "type": "[str]"}, + } + + def __init__(self, *, name: Optional[str] = None, versions: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword name: The product/service name. + :paramtype name: str + :keyword versions: Product/service versions compatible with a service mesh add-on revision. + :paramtype versions: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.versions = versions + + +class ContainerServiceLinuxProfile(_serialization.Model): + """Profile for Linux VMs in the container service cluster. + + All required parameters must be populated in order to send to server. + + :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.v2024_03_02_preview.models.ContainerServiceSshConfiguration + """ + + _validation = { + "admin_username": {"required": True, "pattern": r"^[A-Za-z][-A-Za-z0-9_]*$"}, + "ssh": {"required": True}, + } + + _attribute_map = { + "admin_username": {"key": "adminUsername", "type": "str"}, + "ssh": {"key": "ssh", "type": "ContainerServiceSshConfiguration"}, + } + + def __init__(self, *, admin_username: str, ssh: "_models.ContainerServiceSshConfiguration", **kwargs: Any) -> None: + """ + :keyword admin_username: The administrator username to use for Linux VMs. Required. + :paramtype admin_username: str + :keyword ssh: The SSH configuration for Linux-based VMs running on Azure. Required. + :paramtype ssh: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ContainerServiceSshConfiguration + """ + super().__init__(**kwargs) + self.admin_username = admin_username + self.ssh = ssh + + +class ContainerServiceNetworkProfile(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Profile of network configuration. + + :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.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_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 + not overlap with any Subnet IP ranges. + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :vartype dns_service_ip: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type + `_. Known values are: "loadBalancer", + "userDefinedRouting", "managedNATGateway", and "userAssignedNATGateway". + :vartype outbound_type: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterLoadBalancerProfile + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + :ivar service_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. They must not overlap with + any Subnet IP ranges. + :vartype service_cidrs: list[str] + :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.v2024_03_02_preview.models.IpFamily] + :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.v2024_03_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + :ivar monitoring: This addon can be used to configure network monitoring and generate network + monitoring data in Prometheus format. + :vartype monitoring: ~azure.mgmt.containerservice.v2024_03_02_preview.models.NetworkMonitoring + :ivar advanced_networking: Advanced Networking profile for enabling observability on a cluster. + For more information see aka.ms/aksadvancednetworking. + :vartype advanced_networking: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AdvancedNetworking + """ + + _validation = { + "pod_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "service_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + } + + _attribute_map = { + "network_plugin": {"key": "networkPlugin", "type": "str"}, + "network_plugin_mode": {"key": "networkPluginMode", "type": "str"}, + "network_policy": {"key": "networkPolicy", "type": "str"}, + "network_mode": {"key": "networkMode", "type": "str"}, + "network_dataplane": {"key": "networkDataplane", "type": "str"}, + "pod_cidr": {"key": "podCidr", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "outbound_type": {"key": "outboundType", "type": "str"}, + "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, + "load_balancer_profile": {"key": "loadBalancerProfile", "type": "ManagedClusterLoadBalancerProfile"}, + "nat_gateway_profile": {"key": "natGatewayProfile", "type": "ManagedClusterNATGatewayProfile"}, + "static_egress_gateway_profile": { + "key": "staticEgressGatewayProfile", + "type": "ManagedClusterStaticEgressGatewayProfile", + }, + "pod_cidrs": {"key": "podCidrs", "type": "[str]"}, + "service_cidrs": {"key": "serviceCidrs", "type": "[str]"}, + "ip_families": {"key": "ipFamilies", "type": "[str]"}, + "kube_proxy_config": {"key": "kubeProxyConfig", "type": "ContainerServiceNetworkProfileKubeProxyConfig"}, + "monitoring": {"key": "monitoring", "type": "NetworkMonitoring"}, + "advanced_networking": {"key": "advancedNetworking", "type": "AdvancedNetworking"}, + } + + def __init__( + self, + *, + network_plugin: Union[str, "_models.NetworkPlugin"] = "kubenet", + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, + network_dataplane: Optional[Union[str, "_models.NetworkDataplane"]] = None, + pod_cidr: str = "10.244.0.0/16", + service_cidr: str = "10.0.0.0/16", + dns_service_ip: str = "10.0.0.10", + outbound_type: Union[str, "_models.OutboundType"] = "loadBalancer", + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, + load_balancer_profile: Optional["_models.ManagedClusterLoadBalancerProfile"] = None, + nat_gateway_profile: Optional["_models.ManagedClusterNATGatewayProfile"] = None, + static_egress_gateway_profile: Optional["_models.ManagedClusterStaticEgressGatewayProfile"] = None, + pod_cidrs: Optional[List[str]] = None, + service_cidrs: Optional[List[str]] = None, + ip_families: Optional[List[Union[str, "_models.IpFamily"]]] = None, + kube_proxy_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfig"] = None, + monitoring: Optional["_models.NetworkMonitoring"] = None, + advanced_networking: Optional["_models.AdvancedNetworking"] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_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 + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + later. For more information see `egress outbound type + `_. Known values are: "loadBalancer", + "userDefinedRouting", "managedNATGateway", and "userAssignedNATGateway". + :paramtype outbound_type: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + :keyword service_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. They must not overlap + with any Subnet IP ranges. + :paramtype service_cidrs: list[str] + :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.v2024_03_02_preview.models.IpFamily] + :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.v2024_03_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + :keyword monitoring: This addon can be used to configure network monitoring and generate + network monitoring data in Prometheus format. + :paramtype monitoring: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.NetworkMonitoring + :keyword advanced_networking: Advanced Networking profile for enabling observability on a + cluster. For more information see aka.ms/aksadvancednetworking. + :paramtype advanced_networking: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AdvancedNetworking + """ + super().__init__(**kwargs) + self.network_plugin = network_plugin + self.network_plugin_mode = network_plugin_mode + self.network_policy = network_policy + self.network_mode = network_mode + self.network_dataplane = network_dataplane + self.pod_cidr = pod_cidr + self.service_cidr = service_cidr + self.dns_service_ip = dns_service_ip + self.outbound_type = outbound_type + self.load_balancer_sku = load_balancer_sku + self.load_balancer_profile = load_balancer_profile + self.nat_gateway_profile = nat_gateway_profile + self.static_egress_gateway_profile = static_egress_gateway_profile + self.pod_cidrs = pod_cidrs + self.service_cidrs = service_cidrs + self.ip_families = ip_families + self.kube_proxy_config = kube_proxy_config + self.monitoring = monitoring + self.advanced_networking = advanced_networking + + +class ContainerServiceNetworkProfileKubeProxyConfig(_serialization.Model): # pylint: disable=name-too-long + """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'. + + :ivar enabled: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, + kube-proxy is enabled in AKS by default without these customizations). + :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.v2024_03_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.v2024_03_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "mode": {"key": "mode", "type": "str"}, + "ipvs_config": {"key": "ipvsConfig", "type": "ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + mode: Optional[Union[str, "_models.Mode"]] = None, + ipvs_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' + exists, kube-proxy is enabled in AKS by default without these customizations). + :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.v2024_03_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.v2024_03_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + """ + super().__init__(**kwargs) + self.enabled = enabled + self.mode = mode + self.ipvs_config = ipvs_config + + +class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(_serialization.Model): # pylint: disable=name-too-long + """Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + + :ivar scheduler: IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and + "LeastConnection". + :vartype scheduler: str or + ~azure.mgmt.containerservice.v2024_03_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 + :ivar tcp_fin_timeout_seconds: The timeout value used for IPVS TCP sessions after receiving a + FIN in seconds. Must be a positive integer value. + :vartype tcp_fin_timeout_seconds: int + :ivar udp_timeout_seconds: The timeout value used for IPVS UDP packets in seconds. Must be a + positive integer value. + :vartype udp_timeout_seconds: int + """ + + _attribute_map = { + "scheduler": {"key": "scheduler", "type": "str"}, + "tcp_timeout_seconds": {"key": "tcpTimeoutSeconds", "type": "int"}, + "tcp_fin_timeout_seconds": {"key": "tcpFinTimeoutSeconds", "type": "int"}, + "udp_timeout_seconds": {"key": "udpTimeoutSeconds", "type": "int"}, + } + + def __init__( + self, + *, + scheduler: Optional[Union[str, "_models.IpvsScheduler"]] = None, + tcp_timeout_seconds: Optional[int] = None, + tcp_fin_timeout_seconds: Optional[int] = None, + udp_timeout_seconds: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword scheduler: IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and + "LeastConnection". + :paramtype scheduler: str or + ~azure.mgmt.containerservice.v2024_03_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 + :keyword tcp_fin_timeout_seconds: The timeout value used for IPVS TCP sessions after receiving + a FIN in seconds. Must be a positive integer value. + :paramtype tcp_fin_timeout_seconds: int + :keyword udp_timeout_seconds: The timeout value used for IPVS UDP packets in seconds. Must be a + positive integer value. + :paramtype udp_timeout_seconds: int + """ + super().__init__(**kwargs) + self.scheduler = scheduler + self.tcp_timeout_seconds = tcp_timeout_seconds + self.tcp_fin_timeout_seconds = tcp_fin_timeout_seconds + self.udp_timeout_seconds = udp_timeout_seconds + + +class ContainerServiceSshConfiguration(_serialization.Model): + """SSH configuration for Linux-based VMs running on Azure. + + All required parameters must be populated in order to send to server. + + :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.v2024_03_02_preview.models.ContainerServiceSshPublicKey] + """ + + _validation = { + "public_keys": {"required": True}, + } + + _attribute_map = { + "public_keys": {"key": "publicKeys", "type": "[ContainerServiceSshPublicKey]"}, + } + + def __init__(self, *, public_keys: List["_models.ContainerServiceSshPublicKey"], **kwargs: Any) -> None: + """ + :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.v2024_03_02_preview.models.ContainerServiceSshPublicKey] + """ + super().__init__(**kwargs) + self.public_keys = public_keys + + +class ContainerServiceSshPublicKey(_serialization.Model): + """Contains information about SSH certificate public key data. + + All required parameters must be populated in order to send to server. + + :ivar key_data: Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. Required. + :vartype key_data: str + """ + + _validation = { + "key_data": {"required": True}, + } + + _attribute_map = { + "key_data": {"key": "keyData", "type": "str"}, + } + + def __init__(self, *, key_data: str, **kwargs: Any) -> None: + """ + :keyword key_data: Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. Required. + :paramtype key_data: str + """ + super().__init__(**kwargs) + self.key_data = key_data + + +class CreationData(_serialization.Model): + """Data used when creating a target resource from a source resource. + + :ivar source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :vartype source_resource_id: str + """ + + _attribute_map = { + "source_resource_id": {"key": "sourceResourceId", "type": "str"}, + } + + def __init__(self, *, source_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :paramtype source_resource_id: str + """ + super().__init__(**kwargs) + self.source_resource_id = source_resource_id + + +class CredentialResult(_serialization.Model): + """The credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytes + """ + + _validation = { + "name": {"readonly": True}, + "value": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "bytearray"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.value = None + + +class CredentialResults(_serialization.Model): + """The list credential result response. + + 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.v2024_03_02_preview.models.CredentialResult] + """ + + _validation = { + "kubeconfigs": {"readonly": True}, + } + + _attribute_map = { + "kubeconfigs": {"key": "kubeconfigs", "type": "[CredentialResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.kubeconfigs = None + + +class DailySchedule(_serialization.Model): + """For schedules like: 'recur every day' or 'recur every 3 days'. + + All required parameters must be populated in order to send to server. + + :ivar interval_days: Specifies the number of days between each set of occurrences. Required. + :vartype interval_days: int + """ + + _validation = { + "interval_days": {"required": True, "maximum": 7, "minimum": 1}, + } + + _attribute_map = { + "interval_days": {"key": "intervalDays", "type": "int"}, + } + + def __init__(self, *, interval_days: int, **kwargs: Any) -> None: + """ + :keyword interval_days: Specifies the number of days between each set of occurrences. Required. + :paramtype interval_days: int + """ + super().__init__(**kwargs) + self.interval_days = interval_days + + +class DateSpan(_serialization.Model): + """For example, between '2022-12-23' and '2023-01-05'. + + All required parameters must be populated in order to send to server. + + :ivar start: The start date of the date span. Required. + :vartype start: ~datetime.date + :ivar end: The end date of the date span. Required. + :vartype end: ~datetime.date + """ + + _validation = { + "start": {"required": True}, + "end": {"required": True}, + } + + _attribute_map = { + "start": {"key": "start", "type": "date"}, + "end": {"key": "end", "type": "date"}, + } + + def __init__(self, *, start: datetime.date, end: datetime.date, **kwargs: Any) -> None: + """ + :keyword start: The start date of the date span. Required. + :paramtype start: ~datetime.date + :keyword end: The end date of the date span. Required. + :paramtype end: ~datetime.date + """ + super().__init__(**kwargs) + self.start = start + self.end = end + + +class DelegatedResource(_serialization.Model): + """Delegated resource properties - internal use only. + + :ivar resource_id: The ARM resource id of the delegated resource - internal use only. + :vartype resource_id: str + :ivar tenant_id: The tenant id of the delegated resource - internal use only. + :vartype tenant_id: str + :ivar referral_resource: The delegation id of the referral delegation (optional) - internal use + only. + :vartype referral_resource: str + :ivar location: The source resource location - internal use only. + :vartype location: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "referral_resource": {"key": "referralResource", "type": "str"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + tenant_id: Optional[str] = None, + referral_resource: Optional[str] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The ARM resource id of the delegated resource - internal use only. + :paramtype resource_id: str + :keyword tenant_id: The tenant id of the delegated resource - internal use only. + :paramtype tenant_id: str + :keyword referral_resource: The delegation id of the referral delegation (optional) - internal + use only. + :paramtype referral_resource: str + :keyword location: The source resource location - internal use only. + :paramtype location: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.tenant_id = tenant_id + self.referral_resource = referral_resource + self.location = location + + +class EndpointDependency(_serialization.Model): + """A domain name that AKS agent nodes are reaching at. + + :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.v2024_03_02_preview.models.EndpointDetail] + """ + + _attribute_map = { + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": {"key": "endpointDetails", "type": "[EndpointDetail]"}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["_models.EndpointDetail"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.EndpointDetail] + """ + super().__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(_serialization.Model): + """connect information from the AKS agent nodes to a single endpoint. + + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str + """ + + _attribute_map = { + "ip_address": {"key": "ipAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "protocol": {"key": "protocol", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ + super().__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.protocol = protocol + self.description = description + + +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON + """ + + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + 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 + + +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class ExtendedLocation(_serialization.Model): + """The complex type of the extended location. + + :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.v2024_03_02_preview.models.ExtendedLocationTypes + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_03_02_preview.models.ExtendedLocationTypes + """ + super().__init__(**kwargs) + self.name = name + self.type = type + + +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class GuardrailsAvailableVersion(Resource): + """Available Guardrails Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SystemData + :ivar properties: Whether the version is default or not and support info. Required. + :vartype properties: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.GuardrailsAvailableVersionsProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "GuardrailsAvailableVersionsProperties"}, + } + + def __init__(self, *, properties: "_models.GuardrailsAvailableVersionsProperties", **kwargs: Any) -> None: + """ + :keyword properties: Whether the version is default or not and support info. Required. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.GuardrailsAvailableVersionsProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class GuardrailsAvailableVersionsList(_serialization.Model): + """Hold values properties, which is array of GuardrailsVersions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of AKS supported Guardrails versions. + :vartype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.GuardrailsAvailableVersion] + :ivar next_link: The URL to get the next Guardrails available version. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[GuardrailsAvailableVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.GuardrailsAvailableVersion"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Array of AKS supported Guardrails versions. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.GuardrailsAvailableVersion] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class GuardrailsAvailableVersionsProperties(_serialization.Model): + """Whether the version is default or not and support info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_default_version: + :vartype is_default_version: bool + :ivar support: Whether the version is preview or stable. Known values are: "Preview" and + "Stable". + :vartype support: str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.GuardrailsSupport + """ + + _validation = { + "is_default_version": {"readonly": True}, + "support": {"readonly": True}, + } + + _attribute_map = { + "is_default_version": {"key": "isDefaultVersion", "type": "bool"}, + "support": {"key": "support", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.is_default_version = None + self.support = None + + +class IPTag(_serialization.Model): + """Contains the IPTag associated with the object. + + :ivar ip_tag_type: The IP tag type. Example: RoutingPreference. + :vartype ip_tag_type: str + :ivar tag: The value of the IP tag associated with the public IP. Example: Internet. + :vartype tag: str + """ + + _attribute_map = { + "ip_tag_type": {"key": "ipTagType", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + } + + def __init__(self, *, ip_tag_type: Optional[str] = None, tag: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword ip_tag_type: The IP tag type. Example: RoutingPreference. + :paramtype ip_tag_type: str + :keyword tag: The value of the IP tag associated with the public IP. Example: Internet. + :paramtype tag: str + """ + super().__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag + + +class IstioCertificateAuthority(_serialization.Model): + """Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin + certificates as described here https://aka.ms/asm-plugin-ca. + + :ivar plugin: Plugin certificates information for Service Mesh. + :vartype plugin: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioPluginCertificateAuthority + """ + + _attribute_map = { + "plugin": {"key": "plugin", "type": "IstioPluginCertificateAuthority"}, + } + + def __init__(self, *, plugin: Optional["_models.IstioPluginCertificateAuthority"] = None, **kwargs: Any) -> None: + """ + :keyword plugin: Plugin certificates information for Service Mesh. + :paramtype plugin: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioPluginCertificateAuthority + """ + super().__init__(**kwargs) + self.plugin = plugin + + +class IstioComponents(_serialization.Model): + """Istio components configuration. + + :ivar ingress_gateways: Istio ingress gateways. + :vartype ingress_gateways: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioIngressGateway] + :ivar egress_gateways: Istio egress gateways. + :vartype egress_gateways: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioEgressGateway] + """ + + _attribute_map = { + "ingress_gateways": {"key": "ingressGateways", "type": "[IstioIngressGateway]"}, + "egress_gateways": {"key": "egressGateways", "type": "[IstioEgressGateway]"}, + } + + def __init__( + self, + *, + ingress_gateways: Optional[List["_models.IstioIngressGateway"]] = None, + egress_gateways: Optional[List["_models.IstioEgressGateway"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword ingress_gateways: Istio ingress gateways. + :paramtype ingress_gateways: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioIngressGateway] + :keyword egress_gateways: Istio egress gateways. + :paramtype egress_gateways: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioEgressGateway] + """ + super().__init__(**kwargs) + self.ingress_gateways = ingress_gateways + self.egress_gateways = egress_gateways + + +class IstioEgressGateway(_serialization.Model): + """Istio egress gateway configuration. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable the egress gateway. Required. + :vartype enabled: bool + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: bool, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable the egress gateway. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class IstioIngressGateway(_serialization.Model): + """Istio ingress gateway configuration. For now, we support up to one external ingress gateway + named ``aks-istio-ingressgateway-external`` and one internal ingress gateway named + ``aks-istio-ingressgateway-internal``. + + 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.v2024_03_02_preview.models.IstioIngressGatewayMode + :ivar enabled: Whether to enable the ingress gateway. Required. + :vartype enabled: bool + """ + + _validation = { + "mode": {"required": True}, + "enabled": {"required": True}, + } + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, mode: Union[str, "_models.IstioIngressGatewayMode"], enabled: bool, **kwargs: Any) -> None: + """ + :keyword mode: Mode of an ingress gateway. Required. Known values are: "External" and + "Internal". + :paramtype mode: str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioIngressGatewayMode + :keyword enabled: Whether to enable the ingress gateway. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.mode = mode + self.enabled = enabled + + +class IstioPluginCertificateAuthority(_serialization.Model): + """Plugin certificates information for Service Mesh. + + :ivar key_vault_id: The resource ID of the Key Vault. + :vartype key_vault_id: str + :ivar cert_object_name: Intermediate certificate object name in Azure Key Vault. + :vartype cert_object_name: str + :ivar key_object_name: Intermediate certificate private key object name in Azure Key Vault. + :vartype key_object_name: str + :ivar root_cert_object_name: Root certificate object name in Azure Key Vault. + :vartype root_cert_object_name: str + :ivar cert_chain_object_name: Certificate chain object name in Azure Key Vault. + :vartype cert_chain_object_name: str + """ + + _attribute_map = { + "key_vault_id": {"key": "keyVaultId", "type": "str"}, + "cert_object_name": {"key": "certObjectName", "type": "str"}, + "key_object_name": {"key": "keyObjectName", "type": "str"}, + "root_cert_object_name": {"key": "rootCertObjectName", "type": "str"}, + "cert_chain_object_name": {"key": "certChainObjectName", "type": "str"}, + } + + def __init__( + self, + *, + key_vault_id: Optional[str] = None, + cert_object_name: Optional[str] = None, + key_object_name: Optional[str] = None, + root_cert_object_name: Optional[str] = None, + cert_chain_object_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword key_vault_id: The resource ID of the Key Vault. + :paramtype key_vault_id: str + :keyword cert_object_name: Intermediate certificate object name in Azure Key Vault. + :paramtype cert_object_name: str + :keyword key_object_name: Intermediate certificate private key object name in Azure Key Vault. + :paramtype key_object_name: str + :keyword root_cert_object_name: Root certificate object name in Azure Key Vault. + :paramtype root_cert_object_name: str + :keyword cert_chain_object_name: Certificate chain object name in Azure Key Vault. + :paramtype cert_chain_object_name: str + """ + super().__init__(**kwargs) + self.key_vault_id = key_vault_id + self.cert_object_name = cert_object_name + self.key_object_name = key_object_name + self.root_cert_object_name = root_cert_object_name + self.cert_chain_object_name = cert_chain_object_name + + +class IstioServiceMesh(_serialization.Model): + """Istio service mesh configuration. + + :ivar components: Istio components configuration. + :vartype components: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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: + https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. + :vartype revisions: list[str] + """ + + _validation = { + "revisions": {"max_items": 2, "min_items": 0, "unique": True}, + } + + _attribute_map = { + "components": {"key": "components", "type": "IstioComponents"}, + "certificate_authority": {"key": "certificateAuthority", "type": "IstioCertificateAuthority"}, + "revisions": {"key": "revisions", "type": "[str]"}, + } + + def __init__( + self, + *, + components: Optional["_models.IstioComponents"] = None, + certificate_authority: Optional["_models.IstioCertificateAuthority"] = None, + revisions: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword components: Istio components configuration. + :paramtype components: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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: + https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. + :paramtype revisions: list[str] + """ + super().__init__(**kwargs) + self.components = components + self.certificate_authority = certificate_authority + self.revisions = revisions + + +class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes + """See `AKS custom node configuration + `_ for more details. + + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + 85%. + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + is 80%. + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\\ ). + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + is rotated. + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int + """ + + _validation = { + "container_log_max_files": {"minimum": 2}, + } + + _attribute_map = { + "cpu_manager_policy": {"key": "cpuManagerPolicy", "type": "str"}, + "cpu_cfs_quota": {"key": "cpuCfsQuota", "type": "bool"}, + "cpu_cfs_quota_period": {"key": "cpuCfsQuotaPeriod", "type": "str"}, + "image_gc_high_threshold": {"key": "imageGcHighThreshold", "type": "int"}, + "image_gc_low_threshold": {"key": "imageGcLowThreshold", "type": "int"}, + "topology_manager_policy": {"key": "topologyManagerPolicy", "type": "str"}, + "allowed_unsafe_sysctls": {"key": "allowedUnsafeSysctls", "type": "[str]"}, + "fail_swap_on": {"key": "failSwapOn", "type": "bool"}, + "container_log_max_size_mb": {"key": "containerLogMaxSizeMB", "type": "int"}, + "container_log_max_files": {"key": "containerLogMaxFiles", "type": "int"}, + "pod_max_pids": {"key": "podMaxPids", "type": "int"}, + } + + def __init__( + self, + *, + cpu_manager_policy: Optional[str] = None, + cpu_cfs_quota: Optional[bool] = None, + cpu_cfs_quota_period: Optional[str] = None, + image_gc_high_threshold: Optional[int] = None, + image_gc_low_threshold: Optional[int] = None, + topology_manager_policy: Optional[str] = None, + allowed_unsafe_sysctls: Optional[List[str]] = None, + fail_swap_on: Optional[bool] = None, + container_log_max_size_mb: Optional[int] = None, + container_log_max_files: Optional[int] = None, + pod_max_pids: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ + super().__init__(**kwargs) + self.cpu_manager_policy = cpu_manager_policy + self.cpu_cfs_quota = cpu_cfs_quota + self.cpu_cfs_quota_period = cpu_cfs_quota_period + self.image_gc_high_threshold = image_gc_high_threshold + self.image_gc_low_threshold = image_gc_low_threshold + self.topology_manager_policy = topology_manager_policy + self.allowed_unsafe_sysctls = allowed_unsafe_sysctls + self.fail_swap_on = fail_swap_on + self.container_log_max_size_mb = container_log_max_size_mb + self.container_log_max_files = container_log_max_files + self.pod_max_pids = pod_max_pids + + +class KubernetesPatchVersion(_serialization.Model): + """Kubernetes patch version profile. + + :ivar upgrades: Possible upgrade path for given patch version. + :vartype upgrades: list[str] + """ + + _attribute_map = { + "upgrades": {"key": "upgrades", "type": "[str]"}, + } + + def __init__(self, *, upgrades: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword upgrades: Possible upgrade path for given patch version. + :paramtype upgrades: list[str] + """ + super().__init__(**kwargs) + self.upgrades = upgrades + + +class KubernetesVersion(_serialization.Model): + """Kubernetes version profile for given major.minor release. + + :ivar version: major.minor version of Kubernetes release. + :vartype version: str + :ivar capabilities: Capabilities on this Kubernetes version. + :vartype capabilities: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.KubernetesPatchVersion] + """ + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "capabilities": {"key": "capabilities", "type": "KubernetesVersionCapabilities"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + "patch_versions": {"key": "patchVersions", "type": "{KubernetesPatchVersion}"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + capabilities: Optional["_models.KubernetesVersionCapabilities"] = None, + is_default: Optional[bool] = None, + is_preview: Optional[bool] = None, + patch_versions: Optional[Dict[str, "_models.KubernetesPatchVersion"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: major.minor version of Kubernetes release. + :paramtype version: str + :keyword capabilities: Capabilities on this Kubernetes version. + :paramtype capabilities: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.KubernetesPatchVersion] + """ + super().__init__(**kwargs) + self.version = version + self.capabilities = capabilities + self.is_default = is_default + self.is_preview = is_preview + self.patch_versions = patch_versions + + +class KubernetesVersionCapabilities(_serialization.Model): + """Capabilities on this Kubernetes version. + + :ivar support_plan: + :vartype support_plan: list[str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.KubernetesSupportPlan] + """ + + _attribute_map = { + "support_plan": {"key": "supportPlan", "type": "[str]"}, + } + + def __init__( + self, *, support_plan: Optional[List[Union[str, "_models.KubernetesSupportPlan"]]] = None, **kwargs: Any + ) -> None: + """ + :keyword support_plan: + :paramtype support_plan: list[str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.KubernetesSupportPlan] + """ + super().__init__(**kwargs) + self.support_plan = support_plan + + +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.v2024_03_02_preview.models.KubernetesVersion] + """ + + _attribute_map = { + "values": {"key": "values", "type": "[KubernetesVersion]"}, + } + + 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.v2024_03_02_preview.models.KubernetesVersion] + """ + super().__init__(**kwargs) + self.values = values + + +class LabelSelector(_serialization.Model): + """A label selector is a label query over a set of resources. The result of matchLabels and + matchExpressions are ANDed. An empty label selector matches all objects. A null label selector + matches no objects. + + :ivar match_labels: matchLabels is an array of {key=value} pairs. A single {key=value} in the + matchLabels map is equivalent to an element of matchExpressions, whose key field is ``key``\\ , + the operator is ``In``\\ , and the values array contains only ``value``. The requirements are + ANDed. + :vartype match_labels: list[str] + :ivar match_expressions: matchExpressions is a list of label selector requirements. The + requirements are ANDed. + :vartype match_expressions: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.LabelSelectorRequirement] + """ + + _attribute_map = { + "match_labels": {"key": "matchLabels", "type": "[str]"}, + "match_expressions": {"key": "matchExpressions", "type": "[LabelSelectorRequirement]"}, + } + + def __init__( + self, + *, + match_labels: Optional[List[str]] = None, + match_expressions: Optional[List["_models.LabelSelectorRequirement"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword match_labels: matchLabels is an array of {key=value} pairs. A single {key=value} in + the matchLabels map is equivalent to an element of matchExpressions, whose key field is + ``key``\\ , the operator is ``In``\\ , and the values array contains only ``value``. The + requirements are ANDed. + :paramtype match_labels: list[str] + :keyword match_expressions: matchExpressions is a list of label selector requirements. The + requirements are ANDed. + :paramtype match_expressions: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.LabelSelectorRequirement] + """ + super().__init__(**kwargs) + self.match_labels = match_labels + self.match_expressions = match_expressions + + +class LabelSelectorRequirement(_serialization.Model): + """A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + + :ivar key: key is the label key that the selector applies to. + :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", and "DoesNotExist". + :vartype operator: str or ~azure.mgmt.containerservice.v2024_03_02_preview.models.Operator + :ivar values: values is an array of string values, the values array must be non-empty. + :vartype values: list[str] + """ + + _attribute_map = { + "key": {"key": "key", "type": "str"}, + "operator": {"key": "operator", "type": "str"}, + "values": {"key": "values", "type": "[str]"}, + } + + def __init__( + self, + *, + key: Optional[str] = None, + operator: Optional[Union[str, "_models.Operator"]] = None, + values: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword key: key is the label key that the selector applies to. + :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", and "DoesNotExist". + :paramtype operator: str or ~azure.mgmt.containerservice.v2024_03_02_preview.models.Operator + :keyword values: values is an array of string values, the values array must be non-empty. + :paramtype values: list[str] + """ + super().__init__(**kwargs) + self.key = key + self.operator = operator + self.values = values + + +class LinuxOSConfig(_serialization.Model): + """See `AKS custom node configuration + `_ for more details. + + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2024_03_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 + `_. + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int + """ + + _attribute_map = { + "sysctls": {"key": "sysctls", "type": "SysctlConfig"}, + "transparent_huge_page_enabled": {"key": "transparentHugePageEnabled", "type": "str"}, + "transparent_huge_page_defrag": {"key": "transparentHugePageDefrag", "type": "str"}, + "swap_file_size_mb": {"key": "swapFileSizeMB", "type": "int"}, + } + + def __init__( + self, + *, + sysctls: Optional["_models.SysctlConfig"] = None, + transparent_huge_page_enabled: Optional[str] = None, + transparent_huge_page_defrag: Optional[str] = None, + swap_file_size_mb: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2024_03_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 + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ + super().__init__(**kwargs) + self.sysctls = sysctls + self.transparent_huge_page_enabled = transparent_huge_page_enabled + self.transparent_huge_page_defrag = transparent_huge_page_defrag + self.swap_file_size_mb = swap_file_size_mb + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SystemData + """ + + +class LoadBalancer(ProxyResource): # pylint: disable=too-many-instance-attributes + """The configurations regarding multiple standard load balancers. If not supplied, single load + balancer mode will be used. Multiple standard load balancers mode will be used if at lease one + configuration is supplied. There has to be a configuration named ``kubernetes``. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SystemData + :ivar name_properties_name: Name of the public load balancer. There will be an internal load + balancer created if needed, and the name will be ``-internal``. The internal lb shares + the same configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. There must be a name of kubernetes in the list. + :vartype name_properties_name: str + :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 + agent pool can only be the primary pool for a single load balancer. + :vartype primary_agent_pool_name: str + :ivar allow_service_placement: Whether to automatically place services on the load balancer. If + not supplied, the default value is true. If set to false manually, both of the external and the + internal load balancer will not be selected for services unless they explicitly target it. + :vartype allow_service_placement: bool + :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.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.LabelSelector + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "name_properties_name": {"key": "properties.name", "type": "str"}, + "primary_agent_pool_name": {"key": "properties.primaryAgentPoolName", "type": "str"}, + "allow_service_placement": {"key": "properties.allowServicePlacement", "type": "bool"}, + "service_label_selector": {"key": "properties.serviceLabelSelector", "type": "LabelSelector"}, + "service_namespace_selector": {"key": "properties.serviceNamespaceSelector", "type": "LabelSelector"}, + "node_selector": {"key": "properties.nodeSelector", "type": "LabelSelector"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + name_properties_name: Optional[str] = None, + primary_agent_pool_name: Optional[str] = None, + allow_service_placement: Optional[bool] = None, + service_label_selector: Optional["_models.LabelSelector"] = None, + service_namespace_selector: Optional["_models.LabelSelector"] = None, + node_selector: Optional["_models.LabelSelector"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name_properties_name: Name of the public load balancer. There will be an internal load + balancer created if needed, and the name will be ``-internal``. The internal lb shares + the same configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. There must be a name of kubernetes in the list. + :paramtype name_properties_name: str + :keyword 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 + agent pool can only be the primary pool for a single load balancer. + :paramtype primary_agent_pool_name: str + :keyword allow_service_placement: Whether to automatically place services on the load balancer. + If not supplied, the default value is true. If set to false manually, both of the external and + the internal load balancer will not be selected for services unless they explicitly target it. + :paramtype allow_service_placement: bool + :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.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.LabelSelector + """ + super().__init__(**kwargs) + self.name_properties_name = name_properties_name + self.primary_agent_pool_name = primary_agent_pool_name + self.allow_service_placement = allow_service_placement + self.service_label_selector = service_label_selector + self.service_namespace_selector = service_namespace_selector + self.node_selector = node_selector + self.provisioning_state = None + + +class LoadBalancerListResult(_serialization.Model): + """The response from the List Load Balancers operation. + + 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.v2024_03_02_preview.models.LoadBalancer] + :ivar next_link: The URL to get the next set of load balancer results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[LoadBalancer]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_03_02_preview.models.LoadBalancer] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class Machine(SubResource): + """A machine. Contains details about the underlying virtual machine. A machine may be visible here + but not in kubectl get nodes; if so it may be because the machine has not been registered with + the Kubernetes API Server yet. + + 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 properties: The properties of the machine. + :vartype properties: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MachineProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "properties": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "MachineProperties"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.properties = None + + +class MachineIpAddress(_serialization.Model): + """The machine IP address details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip: IPv4 or IPv6 address of the machine. + :vartype ip: str + :ivar family: To determine if address belongs IPv4 or IPv6 family. Known values are: "IPv4" and + "IPv6". + :vartype family: str or ~azure.mgmt.containerservice.v2024_03_02_preview.models.IpFamily + """ + + _validation = { + "ip": {"readonly": True}, + "family": {"readonly": True}, + } + + _attribute_map = { + "ip": {"key": "ip", "type": "str"}, + "family": {"key": "family", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.ip = None + self.family = None + + +class MachineListResult(_serialization.Model): + """The response from the List Machines operation. + + 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.v2024_03_02_preview.models.Machine] + :ivar next_link: The URL to get the next set of machine results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Machine]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_03_02_preview.models.Machine] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MachineNetworkProperties(_serialization.Model): + """network properties of the machine. + + 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.v2024_03_02_preview.models.MachineIpAddress] + """ + + _validation = { + "ip_addresses": {"readonly": True}, + } + + _attribute_map = { + "ip_addresses": {"key": "ipAddresses", "type": "[MachineIpAddress]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.ip_addresses = None + + +class MachineProperties(_serialization.Model): + """The properties of the machine. + + 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.v2024_03_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 + """ + + _validation = { + "network": {"readonly": True}, + "resource_id": {"readonly": True}, + } + + _attribute_map = { + "network": {"key": "network", "type": "MachineNetworkProperties"}, + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.network = None + self.resource_id = None + + +class MaintenanceConfiguration(SubResource): + """See `planned maintenance `_ for more + information about planned maintenance. + + 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.v2024_03_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.v2024_03_02_preview.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.TimeSpan] + :ivar maintenance_window: Maintenance window for the maintenance configuration. + :vartype maintenance_window: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.MaintenanceWindow + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "time_in_week": {"key": "properties.timeInWeek", "type": "[TimeInWeek]"}, + "not_allowed_time": {"key": "properties.notAllowedTime", "type": "[TimeSpan]"}, + "maintenance_window": {"key": "properties.maintenanceWindow", "type": "MaintenanceWindow"}, + } + + def __init__( + self, + *, + time_in_week: Optional[List["_models.TimeInWeek"]] = None, + not_allowed_time: Optional[List["_models.TimeSpan"]] = None, + maintenance_window: Optional["_models.MaintenanceWindow"] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_03_02_preview.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.TimeSpan] + :keyword maintenance_window: Maintenance window for the maintenance configuration. + :paramtype maintenance_window: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.MaintenanceWindow + """ + super().__init__(**kwargs) + self.system_data = None + self.time_in_week = time_in_week + self.not_allowed_time = not_allowed_time + self.maintenance_window = maintenance_window + + +class MaintenanceConfigurationListResult(_serialization.Model): + """The response from the List maintenance configurations operation. + + 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.v2024_03_02_preview.models.MaintenanceConfiguration] + :ivar next_link: The URL to get the next set of maintenance configuration results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MaintenanceConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.MaintenanceConfiguration"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.MaintenanceConfiguration] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MaintenanceWindow(_serialization.Model): + """Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + + 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.v2024_03_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' + for PST. If not specified, the default is '+00:00'. + :vartype utc_offset: str + :ivar start_date: The date the maintenance window activates. If the current date is before this + date, the maintenance window is inactive and will not be used for upgrades. If not specified, + the maintenance window will be active right away. + :vartype start_date: ~datetime.date + :ivar start_time: The start time of the maintenance window. Accepted values are from '00:00' to + '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means + UTC time '00:00'. Required. + :vartype start_time: str + :ivar not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to + 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.v2024_03_02_preview.models.DateSpan] + """ + + _validation = { + "schedule": {"required": True}, + "duration_hours": {"required": True, "maximum": 24, "minimum": 4}, + "utc_offset": {"pattern": r"^(-|\+)[0-9]{2}:[0-9]{2}$"}, + "start_time": {"required": True, "pattern": r"^\d{2}:\d{2}$"}, + } + + _attribute_map = { + "schedule": {"key": "schedule", "type": "Schedule"}, + "duration_hours": {"key": "durationHours", "type": "int"}, + "utc_offset": {"key": "utcOffset", "type": "str"}, + "start_date": {"key": "startDate", "type": "date"}, + "start_time": {"key": "startTime", "type": "str"}, + "not_allowed_dates": {"key": "notAllowedDates", "type": "[DateSpan]"}, + } + + def __init__( + self, + *, + schedule: "_models.Schedule", + duration_hours: int = 24, + start_time: str, + utc_offset: Optional[str] = None, + start_date: Optional[datetime.date] = None, + not_allowed_dates: Optional[List["_models.DateSpan"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword schedule: Recurrence schedule for the maintenance window. Required. + :paramtype schedule: ~azure.mgmt.containerservice.v2024_03_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 + '-07:00' for PST. If not specified, the default is '+00:00'. + :paramtype utc_offset: str + :keyword start_date: The date the maintenance window activates. If the current date is before + this date, the maintenance window is inactive and will not be used for upgrades. If not + specified, the maintenance window will be active right away. + :paramtype start_date: ~datetime.date + :keyword start_time: The start time of the maintenance window. Accepted values are from '00:00' + to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' + means UTC time '00:00'. Required. + :paramtype start_time: str + :keyword not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to + 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.v2024_03_02_preview.models.DateSpan] + """ + super().__init__(**kwargs) + self.schedule = schedule + self.duration_hours = duration_hours + self.utc_offset = utc_offset + self.start_date = start_date + self.start_time = start_time + self.not_allowed_dates = not_allowed_dates + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_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 + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": 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}"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) + self.tags = tags + self.location = location + + +class ManagedCluster(TrackedResource): # pylint: disable=too-many-instance-attributes + """Managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_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 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 sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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 + 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 1.14.x -> + 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :vartype kubernetes_version: str + :ivar current_kubernetes_version: The version of Kubernetes the Managed Cluster is running. + :vartype current_kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str + :ivar fqdn: The FQDN of the master pool. + :vartype fqdn: str + :ivar private_fqdn: The FQDN of private cluster. + :vartype private_fqdn: str + :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) + headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. + This special FQDN supports CORS, allowing the Azure Portal to function properly. + :vartype azure_portal_fqdn: str + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAgentPoolProfile] + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ContainerServiceLinuxProfile + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterServicePrincipalProfile + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterPodIdentityProfile + :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :vartype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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. + :vartype enable_pod_security_policy: bool + :ivar enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updating of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource. + :vartype enable_namespace_resources: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ContainerServiceNetworkProfile + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAutoUpgradeProfile + :ivar upgrade_settings: Settings for upgrading a cluster. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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 + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2024_03_02_preview.models.UserAssignedIdentity] + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: + list[~azure.mgmt.containerservice.v2024_03_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 + `_. + :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.v2024_03_02_preview.models.ManagedClusterHTTPProxyConfig + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSecurityProfile + :ivar storage_profile: Storage profile for the managed cluster. + :vartype storage_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfile + :ivar ingress_profile: Ingress profile for the managed cluster. + :vartype ingress_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + :ivar azure_monitor_profile: Prometheus addon profile for the container service cluster. + :vartype azure_monitor_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.SafeguardsProfile + :ivar service_mesh_profile: Service mesh profile for a managed cluster. + :vartype service_mesh_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterAIToolchainOperatorProfile + :ivar node_provisioning_profile: Node provisioning settings that apply to the whole cluster. + :vartype node_provisioning_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterNodeProvisioningProfile + :ivar bootstrap_profile: Profile of the cluster bootstrap configuration. + :vartype bootstrap_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterBootstrapProfile + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "e_tag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "power_state": {"readonly": True}, + "max_agent_pools": {"readonly": True}, + "current_kubernetes_version": {"readonly": True}, + "fqdn": {"readonly": True}, + "private_fqdn": {"readonly": True}, + "azure_portal_fqdn": {"readonly": True}, + "resource_uid": {"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}"}, + "location": {"key": "location", "type": "str"}, + "e_tag": {"key": "eTag", "type": "str"}, + "sku": {"key": "sku", "type": "ManagedClusterSKU"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "identity": {"key": "identity", "type": "ManagedClusterIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "power_state": {"key": "properties.powerState", "type": "PowerState"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "max_agent_pools": {"key": "properties.maxAgentPools", "type": "int"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "current_kubernetes_version": {"key": "properties.currentKubernetesVersion", "type": "str"}, + "dns_prefix": {"key": "properties.dnsPrefix", "type": "str"}, + "fqdn_subdomain": {"key": "properties.fqdnSubdomain", "type": "str"}, + "fqdn": {"key": "properties.fqdn", "type": "str"}, + "private_fqdn": {"key": "properties.privateFQDN", "type": "str"}, + "azure_portal_fqdn": {"key": "properties.azurePortalFQDN", "type": "str"}, + "agent_pool_profiles": {"key": "properties.agentPoolProfiles", "type": "[ManagedClusterAgentPoolProfile]"}, + "linux_profile": {"key": "properties.linuxProfile", "type": "ContainerServiceLinuxProfile"}, + "windows_profile": {"key": "properties.windowsProfile", "type": "ManagedClusterWindowsProfile"}, + "service_principal_profile": { + "key": "properties.servicePrincipalProfile", + "type": "ManagedClusterServicePrincipalProfile", + }, + "addon_profiles": {"key": "properties.addonProfiles", "type": "{ManagedClusterAddonProfile}"}, + "pod_identity_profile": {"key": "properties.podIdentityProfile", "type": "ManagedClusterPodIdentityProfile"}, + "oidc_issuer_profile": {"key": "properties.oidcIssuerProfile", "type": "ManagedClusterOIDCIssuerProfile"}, + "node_resource_group": {"key": "properties.nodeResourceGroup", "type": "str"}, + "node_resource_group_profile": { + "key": "properties.nodeResourceGroupProfile", + "type": "ManagedClusterNodeResourceGroupProfile", + }, + "enable_rbac": {"key": "properties.enableRBAC", "type": "bool"}, + "support_plan": {"key": "properties.supportPlan", "type": "str"}, + "enable_pod_security_policy": {"key": "properties.enablePodSecurityPolicy", "type": "bool"}, + "enable_namespace_resources": {"key": "properties.enableNamespaceResources", "type": "bool"}, + "network_profile": {"key": "properties.networkProfile", "type": "ContainerServiceNetworkProfile"}, + "aad_profile": {"key": "properties.aadProfile", "type": "ManagedClusterAADProfile"}, + "auto_upgrade_profile": {"key": "properties.autoUpgradeProfile", "type": "ManagedClusterAutoUpgradeProfile"}, + "upgrade_settings": {"key": "properties.upgradeSettings", "type": "ClusterUpgradeSettings"}, + "auto_scaler_profile": { + "key": "properties.autoScalerProfile", + "type": "ManagedClusterPropertiesAutoScalerProfile", + }, + "api_server_access_profile": { + "key": "properties.apiServerAccessProfile", + "type": "ManagedClusterAPIServerAccessProfile", + }, + "disk_encryption_set_id": {"key": "properties.diskEncryptionSetID", "type": "str"}, + "identity_profile": {"key": "properties.identityProfile", "type": "{UserAssignedIdentity}"}, + "private_link_resources": {"key": "properties.privateLinkResources", "type": "[PrivateLinkResource]"}, + "disable_local_accounts": {"key": "properties.disableLocalAccounts", "type": "bool"}, + "http_proxy_config": {"key": "properties.httpProxyConfig", "type": "ManagedClusterHTTPProxyConfig"}, + "security_profile": {"key": "properties.securityProfile", "type": "ManagedClusterSecurityProfile"}, + "storage_profile": {"key": "properties.storageProfile", "type": "ManagedClusterStorageProfile"}, + "ingress_profile": {"key": "properties.ingressProfile", "type": "ManagedClusterIngressProfile"}, + "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "workload_auto_scaler_profile": { + "key": "properties.workloadAutoScalerProfile", + "type": "ManagedClusterWorkloadAutoScalerProfile", + }, + "azure_monitor_profile": {"key": "properties.azureMonitorProfile", "type": "ManagedClusterAzureMonitorProfile"}, + "safeguards_profile": {"key": "properties.safeguardsProfile", "type": "SafeguardsProfile"}, + "service_mesh_profile": {"key": "properties.serviceMeshProfile", "type": "ServiceMeshProfile"}, + "resource_uid": {"key": "properties.resourceUID", "type": "str"}, + "metrics_profile": {"key": "properties.metricsProfile", "type": "ManagedClusterMetricsProfile"}, + "ai_toolchain_operator_profile": { + "key": "properties.aiToolchainOperatorProfile", + "type": "ManagedClusterAIToolchainOperatorProfile", + }, + "node_provisioning_profile": { + "key": "properties.nodeProvisioningProfile", + "type": "ManagedClusterNodeProvisioningProfile", + }, + "bootstrap_profile": {"key": "properties.bootstrapProfile", "type": "ManagedClusterBootstrapProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["_models.ManagedClusterSKU"] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + identity: Optional["_models.ManagedClusterIdentity"] = None, + kind: Optional[str] = None, + creation_data: Optional["_models.CreationData"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + fqdn_subdomain: Optional[str] = None, + agent_pool_profiles: Optional[List["_models.ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["_models.ContainerServiceLinuxProfile"] = None, + windows_profile: Optional["_models.ManagedClusterWindowsProfile"] = None, + service_principal_profile: Optional["_models.ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "_models.ManagedClusterAddonProfile"]] = None, + pod_identity_profile: Optional["_models.ManagedClusterPodIdentityProfile"] = None, + oidc_issuer_profile: Optional["_models.ManagedClusterOIDCIssuerProfile"] = None, + node_resource_group: Optional[str] = None, + 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, + enable_namespace_resources: Optional[bool] = None, + network_profile: Optional["_models.ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["_models.ManagedClusterAADProfile"] = None, + auto_upgrade_profile: Optional["_models.ManagedClusterAutoUpgradeProfile"] = None, + upgrade_settings: Optional["_models.ClusterUpgradeSettings"] = None, + auto_scaler_profile: Optional["_models.ManagedClusterPropertiesAutoScalerProfile"] = None, + api_server_access_profile: Optional["_models.ManagedClusterAPIServerAccessProfile"] = None, + disk_encryption_set_id: Optional[str] = None, + identity_profile: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + private_link_resources: Optional[List["_models.PrivateLinkResource"]] = None, + disable_local_accounts: Optional[bool] = None, + http_proxy_config: Optional["_models.ManagedClusterHTTPProxyConfig"] = None, + security_profile: Optional["_models.ManagedClusterSecurityProfile"] = None, + storage_profile: Optional["_models.ManagedClusterStorageProfile"] = None, + ingress_profile: Optional["_models.ManagedClusterIngressProfile"] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, + workload_auto_scaler_profile: Optional["_models.ManagedClusterWorkloadAutoScalerProfile"] = None, + azure_monitor_profile: Optional["_models.ManagedClusterAzureMonitorProfile"] = None, + safeguards_profile: Optional["_models.SafeguardsProfile"] = None, + service_mesh_profile: Optional["_models.ServiceMeshProfile"] = None, + metrics_profile: Optional["_models.ManagedClusterMetricsProfile"] = None, + ai_toolchain_operator_profile: Optional["_models.ManagedClusterAIToolchainOperatorProfile"] = None, + node_provisioning_profile: Optional["_models.ManagedClusterNodeProvisioningProfile"] = None, + bootstrap_profile: Optional["_models.ManagedClusterBootstrapProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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 + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterPodIdentityProfile + :keyword oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :paramtype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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. + :paramtype enable_pod_security_policy: bool + :keyword enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updating of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource. + :paramtype enable_namespace_resources: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAutoUpgradeProfile + :keyword upgrade_settings: Settings for upgrading a cluster. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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 + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2024_03_02_preview.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2024_03_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 + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSecurityProfile + :keyword storage_profile: Storage profile for the managed cluster. + :paramtype storage_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfile + :keyword ingress_profile: Ingress profile for the managed cluster. + :paramtype ingress_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + :keyword azure_monitor_profile: Prometheus addon profile for the container service cluster. + :paramtype azure_monitor_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.SafeguardsProfile + :keyword service_mesh_profile: Service mesh profile for a managed cluster. + :paramtype service_mesh_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ServiceMeshProfile + :keyword metrics_profile: Optional cluster metrics configuration. + :paramtype metrics_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterAIToolchainOperatorProfile + :keyword node_provisioning_profile: Node provisioning settings that apply to the whole cluster. + :paramtype node_provisioning_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterNodeProvisioningProfile + :keyword bootstrap_profile: Profile of the cluster bootstrap configuration. + :paramtype bootstrap_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterBootstrapProfile + """ + super().__init__(tags=tags, location=location, **kwargs) + self.e_tag = None + self.sku = sku + self.extended_location = extended_location + self.identity = identity + self.kind = kind + self.provisioning_state = None + self.power_state = None + self.creation_data = creation_data + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.current_kubernetes_version = None + self.dns_prefix = dns_prefix + self.fqdn_subdomain = fqdn_subdomain + self.fqdn = None + self.private_fqdn = None + self.azure_portal_fqdn = None + self.agent_pool_profiles = agent_pool_profiles + self.linux_profile = linux_profile + self.windows_profile = windows_profile + self.service_principal_profile = service_principal_profile + self.addon_profiles = addon_profiles + self.pod_identity_profile = pod_identity_profile + self.oidc_issuer_profile = oidc_issuer_profile + self.node_resource_group = node_resource_group + 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.enable_namespace_resources = enable_namespace_resources + self.network_profile = network_profile + self.aad_profile = aad_profile + self.auto_upgrade_profile = auto_upgrade_profile + self.upgrade_settings = upgrade_settings + self.auto_scaler_profile = auto_scaler_profile + self.api_server_access_profile = api_server_access_profile + self.disk_encryption_set_id = disk_encryption_set_id + self.identity_profile = identity_profile + self.private_link_resources = private_link_resources + self.disable_local_accounts = disable_local_accounts + self.http_proxy_config = http_proxy_config + self.security_profile = security_profile + self.storage_profile = storage_profile + self.ingress_profile = ingress_profile + self.public_network_access = public_network_access + self.workload_auto_scaler_profile = workload_auto_scaler_profile + self.azure_monitor_profile = azure_monitor_profile + self.safeguards_profile = safeguards_profile + self.service_mesh_profile = service_mesh_profile + self.resource_uid = None + self.metrics_profile = metrics_profile + self.ai_toolchain_operator_profile = ai_toolchain_operator_profile + self.node_provisioning_profile = node_provisioning_profile + self.bootstrap_profile = bootstrap_profile + + +class ManagedClusterAADProfile(_serialization.Model): + """For more details see `managed AAD on AKS `_. + + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: (DEPRECATED) The client AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype client_app_id: str + :ivar server_app_id: (DEPRECATED) The server AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype server_app_id: str + :ivar server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :vartype tenant_id: str + """ + + _attribute_map = { + "managed": {"key": "managed", "type": "bool"}, + "enable_azure_rbac": {"key": "enableAzureRBAC", "type": "bool"}, + "admin_group_object_i_ds": {"key": "adminGroupObjectIDs", "type": "[str]"}, + "client_app_id": {"key": "clientAppID", "type": "str"}, + "server_app_id": {"key": "serverAppID", "type": "str"}, + "server_app_secret": {"key": "serverAppSecret", "type": "str"}, + "tenant_id": {"key": "tenantID", "type": "str"}, + } + + def __init__( + self, + *, + managed: Optional[bool] = None, + enable_azure_rbac: Optional[bool] = None, + admin_group_object_i_ds: Optional[List[str]] = None, + client_app_id: Optional[str] = None, + server_app_id: Optional[str] = None, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: (DEPRECATED) The client AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype client_app_id: str + :keyword server_app_id: (DEPRECATED) The server AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype server_app_id: str + :keyword server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ + super().__init__(**kwargs) + self.managed = managed + self.enable_azure_rbac = enable_azure_rbac + self.admin_group_object_i_ds = admin_group_object_i_ds + self.client_app_id = client_app_id + self.server_app_id = server_app_id + self.server_app_secret = server_app_secret + self.tenant_id = tenant_id + + +class ManagedClusterAccessProfile(TrackedResource): + """Managed cluster Access Profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_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 kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytes + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": 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}"}, + "location": {"key": "location", "type": "str"}, + "kube_config": {"key": "properties.kubeConfig", "type": "bytearray"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytes] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytes + """ + super().__init__(tags=tags, location=location, **kwargs) + self.kube_config = kube_config + + +class ManagedClusterAddonProfile(_serialization.Model): + """A Kubernetes add-on profile for a managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether the add-on is enabled or not. Required. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] + :ivar identity: Information of user assigned identity used by this add-on. + :vartype identity: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAddonProfileIdentity + """ + + _validation = { + "enabled": {"required": True}, + "identity": {"readonly": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "config": {"key": "config", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedClusterAddonProfileIdentity"}, + } + + def __init__(self, *, enabled: bool, config: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether the add-on is enabled or not. Required. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.config = config + self.identity = None + + +class UserAssignedIdentity(_serialization.Model): + """Details about a user assigned identity. + + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.client_id = client_id + self.object_id = object_id + + +class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): + """Information of user assigned identity used by this add-on. + + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str + """ + + +class ManagedClusterAgentPoolProfileProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Properties for the container service agent pool profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_03_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.v2024_03_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.v2024_03_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_03_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.v2024_03_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.v2024_03_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_03_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.v2024_03_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.v2024_03_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_03_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.v2024_03_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_03_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_03_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_03_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.v2024_03_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 + 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.v2024_03_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.AgentPoolGatewayProfile + """ + + _validation = { + "e_tag": {"readonly": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "e_tag": {"key": "eTag", "type": "str"}, + "count": {"key": "count", "type": "int"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "maxPods", "type": "int"}, + "os_type": {"key": "osType", "type": "str"}, + "os_sku": {"key": "osSKU", "type": "str"}, + "max_count": {"key": "maxCount", "type": "int"}, + "min_count": {"key": "minCount", "type": "int"}, + "enable_auto_scaling": {"key": "enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "scaleDownMode", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "power_state": {"key": "powerState", "type": "PowerState"}, + "availability_zones": {"key": "availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "spotMaxPrice", "type": "float"}, + "tags": {"key": "tags", "type": "{str}"}, + "node_labels": {"key": "nodeLabels", "type": "{str}"}, + "node_taints": {"key": "nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "hostGroupID", "type": "str"}, + "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, + "virtual_machines_profile": {"key": "virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": {"key": "virtualMachineNodesStatus", "type": "[VirtualMachineNodes]"}, + "gateway_profile": {"key": "gatewayProfile", "type": "AgentPoolGatewayProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_03_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.v2024_03_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.v2024_03_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_03_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.v2024_03_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.v2024_03_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_03_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.v2024_03_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.v2024_03_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_03_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.v2024_03_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_03_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_03_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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 + 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.v2024_03_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.AgentPoolGatewayProfile + """ + super().__init__(**kwargs) + self.e_tag = None + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.message_of_the_day = message_of_the_day + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.pod_ip_allocation_mode = pod_ip_allocation_mode + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type = type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.current_orchestrator_version = None + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = power_state + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.enable_custom_ca_trust = enable_custom_ca_trust + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.node_initialization_taints = node_initialization_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + self.capacity_reservation_group_id = capacity_reservation_group_id + self.host_group_id = host_group_id + self.windows_profile = windows_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.gpu_profile = gpu_profile + self.artifact_streaming_profile = artifact_streaming_profile + self.virtual_machines_profile = virtual_machines_profile + self.virtual_machine_nodes_status = virtual_machine_nodes_status + self.gateway_profile = gateway_profile + + +class ManagedClusterAgentPoolProfile( + ManagedClusterAgentPoolProfileProperties +): # pylint: disable=too-many-instance-attributes + """Profile for the container service agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_03_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.v2024_03_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.v2024_03_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_03_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.v2024_03_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.v2024_03_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_03_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.v2024_03_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.v2024_03_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_03_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.v2024_03_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_03_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_03_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_03_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.v2024_03_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 + 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.v2024_03_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.AgentPoolGatewayProfile + :ivar name: Windows agent pool names must be 6 characters or less. Required. + :vartype name: str + """ + + _validation = { + "e_tag": {"readonly": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "name": {"required": True, "pattern": r"^[a-z][a-z0-9]{0,11}$"}, + } + + _attribute_map = { + "e_tag": {"key": "eTag", "type": "str"}, + "count": {"key": "count", "type": "int"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "maxPods", "type": "int"}, + "os_type": {"key": "osType", "type": "str"}, + "os_sku": {"key": "osSKU", "type": "str"}, + "max_count": {"key": "maxCount", "type": "int"}, + "min_count": {"key": "minCount", "type": "int"}, + "enable_auto_scaling": {"key": "enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "scaleDownMode", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "power_state": {"key": "powerState", "type": "PowerState"}, + "availability_zones": {"key": "availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "spotMaxPrice", "type": "float"}, + "tags": {"key": "tags", "type": "{str}"}, + "node_labels": {"key": "nodeLabels", "type": "{str}"}, + "node_taints": {"key": "nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "hostGroupID", "type": "str"}, + "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, + "virtual_machines_profile": {"key": "virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": {"key": "virtualMachineNodesStatus", "type": "[VirtualMachineNodes]"}, + "gateway_profile": {"key": "gatewayProfile", "type": "AgentPoolGatewayProfile"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_03_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.v2024_03_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.v2024_03_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_03_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.v2024_03_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.v2024_03_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_03_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.v2024_03_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.v2024_03_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_03_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.v2024_03_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_03_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_03_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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 + 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.v2024_03_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.AgentPoolGatewayProfile + :keyword name: Windows agent pool names must be 6 characters or less. Required. + :paramtype name: str + """ + super().__init__( + count=count, + vm_size=vm_size, + os_disk_size_gb=os_disk_size_gb, + os_disk_type=os_disk_type, + kubelet_disk_type=kubelet_disk_type, + workload_runtime=workload_runtime, + message_of_the_day=message_of_the_day, + vnet_subnet_id=vnet_subnet_id, + pod_subnet_id=pod_subnet_id, + pod_ip_allocation_mode=pod_ip_allocation_mode, + max_pods=max_pods, + os_type=os_type, + os_sku=os_sku, + max_count=max_count, + min_count=min_count, + enable_auto_scaling=enable_auto_scaling, + scale_down_mode=scale_down_mode, + type=type, + mode=mode, + orchestrator_version=orchestrator_version, + upgrade_settings=upgrade_settings, + power_state=power_state, + availability_zones=availability_zones, + enable_node_public_ip=enable_node_public_ip, + enable_custom_ca_trust=enable_custom_ca_trust, + node_public_ip_prefix_id=node_public_ip_prefix_id, + scale_set_priority=scale_set_priority, + scale_set_eviction_policy=scale_set_eviction_policy, + spot_max_price=spot_max_price, + tags=tags, + node_labels=node_labels, + node_taints=node_taints, + node_initialization_taints=node_initialization_taints, + proximity_placement_group_id=proximity_placement_group_id, + kubelet_config=kubelet_config, + linux_os_config=linux_os_config, + enable_encryption_at_host=enable_encryption_at_host, + enable_ultra_ssd=enable_ultra_ssd, + enable_fips=enable_fips, + gpu_instance_profile=gpu_instance_profile, + creation_data=creation_data, + capacity_reservation_group_id=capacity_reservation_group_id, + host_group_id=host_group_id, + windows_profile=windows_profile, + network_profile=network_profile, + security_profile=security_profile, + gpu_profile=gpu_profile, + artifact_streaming_profile=artifact_streaming_profile, + virtual_machines_profile=virtual_machines_profile, + virtual_machine_nodes_status=virtual_machine_nodes_status, + gateway_profile=gateway_profile, + **kwargs + ) + self.name = name + + +class ManagedClusterAIToolchainOperatorProfile(_serialization.Model): + """When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the + cluster. The operator automates the deployment of OSS models for inference and/or training + purposes. It provides a set of preset models and enables distributed inference against them. + + :ivar enabled: Indicates if AI toolchain operator enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if AI toolchain operator enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterAPIServerAccessProfile(_serialization.Model): + """Access profile for managed cluster API server. + + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + cluster or not. + :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. + :vartype enable_vnet_integration: bool + :ivar subnet_id: It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an + existing cluster to enable apiserver vnet integration. + :vartype subnet_id: str + """ + + _attribute_map = { + "authorized_ip_ranges": {"key": "authorizedIPRanges", "type": "[str]"}, + "enable_private_cluster": {"key": "enablePrivateCluster", "type": "bool"}, + "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__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + 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: + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :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. + :paramtype enable_vnet_integration: bool + :keyword subnet_id: It is required when: 1. creating a new cluster with BYO Vnet; 2. updating + an existing cluster to enable apiserver vnet integration. + :paramtype subnet_id: str + """ + super().__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + 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): + """Auto upgrade profile for a managed cluster. + + :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.v2024_03_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.v2024_03_02_preview.models.NodeOSUpgradeChannel + """ + + _attribute_map = { + "upgrade_channel": {"key": "upgradeChannel", "type": "str"}, + "node_os_upgrade_channel": {"key": "nodeOSUpgradeChannel", "type": "str"}, + } + + def __init__( + self, + *, + upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = None, + node_os_upgrade_channel: Optional[Union[str, "_models.NodeOSUpgradeChannel"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Known values are: "rapid", "stable", "patch", "node-image", and "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.NodeOSUpgradeChannel + """ + super().__init__(**kwargs) + self.upgrade_channel = upgrade_channel + self.node_os_upgrade_channel = node_os_upgrade_channel + + +class ManagedClusterAzureMonitorProfile(_serialization.Model): + """Prometheus addon profile for the container service cluster. + + :ivar metrics: Metrics profile for the prometheus service addon. + :vartype metrics: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring + """ + + _attribute_map = { + "metrics": {"key": "metrics", "type": "ManagedClusterAzureMonitorProfileMetrics"}, + "container_insights": { + "key": "containerInsights", + "type": "ManagedClusterAzureMonitorProfileContainerInsights", + }, + "app_monitoring": {"key": "appMonitoring", "type": "ManagedClusterAzureMonitorProfileAppMonitoring"}, + } + + def __init__( + self, + *, + metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = None, + container_insights: Optional["_models.ManagedClusterAzureMonitorProfileContainerInsights"] = None, + app_monitoring: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoring"] = None, + **kwargs: Any + ) -> None: + """ + :keyword metrics: Metrics profile for the prometheus service addon. + :paramtype metrics: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring + """ + super().__init__(**kwargs) + self.metrics = metrics + self.container_insights = container_insights + self.app_monitoring = app_monitoring + + +class ManagedClusterAzureMonitorProfileAppMonitoring(_serialization.Model): # pylint: disable=name-too-long + """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. + + :ivar auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes + Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based + SDKs to collect OpenTelemetry metrics, logs and traces of the application. See + aka.ms/AzureMonitorApplicationMonitoring for an overview. + :vartype auto_instrumentation: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation # pylint: disable=line-too-long + :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.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics # pylint: disable=line-too-long + :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.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs # pylint: disable=line-too-long + """ + + _attribute_map = { + "auto_instrumentation": { + "key": "autoInstrumentation", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation", + }, + "open_telemetry_metrics": { + "key": "openTelemetryMetrics", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics", + }, + "open_telemetry_logs": { + "key": "openTelemetryLogs", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs", + }, + } + + def __init__( + self, + *, + auto_instrumentation: Optional[ + "_models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation" + ] = None, + open_telemetry_metrics: Optional[ + "_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics" + ] = None, + open_telemetry_logs: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs"] = None, + **kwargs: Any + ) -> None: + """ + :keyword auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes + Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based + SDKs to collect OpenTelemetry metrics, logs and traces of the application. See + aka.ms/AzureMonitorApplicationMonitoring for an overview. + :paramtype auto_instrumentation: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation # pylint: disable=line-too-long + :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.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics # pylint: disable=line-too-long + :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.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.auto_instrumentation = auto_instrumentation + self.open_telemetry_metrics = open_telemetry_metrics + self.open_telemetry_logs = open_telemetry_logs + + +class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation( + _serialization.Model +): # pylint: disable=name-too-long + """Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web + hook to auto-instrument Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry + metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for + an overview. + + :ivar enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs( + _serialization.Model +): # pylint: disable=name-too-long + """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. + + :ivar enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or + not. + :vartype enabled: bool + :ivar port: The Open Telemetry host port for Open Telemetry logs and traces. If not specified, + the default port is 28331. + :vartype port: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled + or not. + :paramtype enabled: bool + :keyword port: The Open Telemetry host port for Open Telemetry logs and traces. If not + specified, the default port is 28331. + :paramtype port: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.port = port + + +class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics( + _serialization.Model +): # pylint: disable=name-too-long + """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. + + :ivar enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + :vartype enabled: bool + :ivar port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the + default port is 28333. + :vartype port: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + :paramtype enabled: bool + :keyword port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the + default port is 28333. + :paramtype port: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.port = port + + +class ManagedClusterAzureMonitorProfileContainerInsights(_serialization.Model): # pylint: disable=name-too-long + """Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout + & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview. + + :ivar enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log + Analytics Workspace for storing Azure Monitor Container Insights Logs. + :vartype log_analytics_workspace_resource_id: str + :ivar syslog_port: The syslog host port. If not specified, the default port is 28330. + :vartype syslog_port: int + :ivar disable_custom_metrics: Indicates whether custom metrics collection has to be disabled or + not. If not specified the default is false. No custom metrics will be emitted if this field is + false but the container insights enabled field is false. + :vartype disable_custom_metrics: bool + :ivar disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is + disabled or not. If not specified the default is false. No prometheus metrics will be emitted + if this field is false but the container insights enabled field is false. + :vartype disable_prometheus_metrics_scraping: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, + "syslog_port": {"key": "syslogPort", "type": "int"}, + "disable_custom_metrics": {"key": "disableCustomMetrics", "type": "bool"}, + "disable_prometheus_metrics_scraping": {"key": "disablePrometheusMetricsScraping", "type": "bool"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + log_analytics_workspace_resource_id: Optional[str] = None, + syslog_port: Optional[int] = None, + disable_custom_metrics: Optional[bool] = None, + disable_prometheus_metrics_scraping: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + :paramtype enabled: bool + :keyword log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log + Analytics Workspace for storing Azure Monitor Container Insights Logs. + :paramtype log_analytics_workspace_resource_id: str + :keyword syslog_port: The syslog host port. If not specified, the default port is 28330. + :paramtype syslog_port: int + :keyword disable_custom_metrics: Indicates whether custom metrics collection has to be disabled + or not. If not specified the default is false. No custom metrics will be emitted if this field + is false but the container insights enabled field is false. + :paramtype disable_custom_metrics: bool + :keyword disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is + disabled or not. If not specified the default is false. No prometheus metrics will be emitted + if this field is false but the container insights enabled field is false. + :paramtype disable_prometheus_metrics_scraping: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + self.syslog_port = syslog_port + self.disable_custom_metrics = disable_custom_metrics + self.disable_prometheus_metrics_scraping = disable_prometheus_metrics_scraping + + +class ManagedClusterAzureMonitorProfileKubeStateMetrics(_serialization.Model): # pylint: disable=name-too-long + """Kube State Metrics for prometheus addon profile for the container service cluster. + + :ivar metric_labels_allowlist: Comma-separated list of Kubernetes annotations keys that will be + used in the resource's labels metric. + :vartype metric_labels_allowlist: str + :ivar metric_annotations_allow_list: Comma-separated list of additional Kubernetes label keys + that will be used in the resource's labels metric. + :vartype metric_annotations_allow_list: str + """ + + _attribute_map = { + "metric_labels_allowlist": {"key": "metricLabelsAllowlist", "type": "str"}, + "metric_annotations_allow_list": {"key": "metricAnnotationsAllowList", "type": "str"}, + } + + def __init__( + self, + *, + metric_labels_allowlist: Optional[str] = None, + metric_annotations_allow_list: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword metric_labels_allowlist: Comma-separated list of Kubernetes annotations keys that will + be used in the resource's labels metric. + :paramtype metric_labels_allowlist: str + :keyword metric_annotations_allow_list: Comma-separated list of additional Kubernetes label + keys that will be used in the resource's labels metric. + :paramtype metric_annotations_allow_list: str + """ + super().__init__(**kwargs) + self.metric_labels_allowlist = metric_labels_allowlist + self.metric_annotations_allow_list = metric_annotations_allow_list + + +class ManagedClusterAzureMonitorProfileMetrics(_serialization.Model): + """Metrics profile for the prometheus service addon. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable the Prometheus collector. Required. + :vartype enabled: bool + :ivar kube_state_metrics: Kube State Metrics for prometheus addon profile for the container + service cluster. + :vartype kube_state_metrics: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "kube_state_metrics": {"key": "kubeStateMetrics", "type": "ManagedClusterAzureMonitorProfileKubeStateMetrics"}, + } + + def __init__( + self, + *, + enabled: bool, + kube_state_metrics: Optional["_models.ManagedClusterAzureMonitorProfileKubeStateMetrics"] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable the Prometheus collector. Required. + :paramtype enabled: bool + :keyword kube_state_metrics: Kube State Metrics for prometheus addon profile for the container + service cluster. + :paramtype kube_state_metrics: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + """ + super().__init__(**kwargs) + self.enabled = enabled + self.kube_state_metrics = kube_state_metrics + + +class ManagedClusterBootstrapProfile(_serialization.Model): + """The bootstrap profile. + + :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.v2024_03_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 + """ + + _attribute_map = { + "artifact_source": {"key": "artifactSource", "type": "str"}, + "container_registry_id": {"key": "containerRegistryId", "type": "str"}, + } + + def __init__( + self, + *, + artifact_source: Union[str, "_models.ArtifactSource"] = "Direct", + container_registry_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_03_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 + """ + super().__init__(**kwargs) + self.artifact_source = artifact_source + self.container_registry_id = container_registry_id + + +class ManagedClusterCostAnalysis(_serialization.Model): + """The cost analysis configuration for the cluster. + + :ivar enabled: The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable + this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost + Analysis views in the Azure portal. If not specified, the default is false. For more + information see aka.ms/aks/docs/cost-analysis. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable + this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost + Analysis views in the Azure portal. If not specified, the default is false. For more + information see aka.ms/aks/docs/cost-analysis. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterHTTPProxyConfig(_serialization.Model): + """Cluster HTTP proxy configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar effective_no_proxy: A read-only list of all endpoints for which traffic should not be + sent to the proxy. This list is a superset of noProxy and values injected by AKS. + :vartype effective_no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str + """ + + _validation = { + "effective_no_proxy": {"readonly": True}, + } + + _attribute_map = { + "http_proxy": {"key": "httpProxy", "type": "str"}, + "https_proxy": {"key": "httpsProxy", "type": "str"}, + "no_proxy": {"key": "noProxy", "type": "[str]"}, + "effective_no_proxy": {"key": "effectiveNoProxy", "type": "[str]"}, + "trusted_ca": {"key": "trustedCa", "type": "str"}, + } + + def __init__( + self, + *, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, + no_proxy: Optional[List[str]] = None, + trusted_ca: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ + super().__init__(**kwargs) + self.http_proxy = http_proxy + self.https_proxy = https_proxy + self.no_proxy = no_proxy + self.effective_no_proxy = None + self.trusted_ca = trusted_ca + + +class ManagedClusterIdentity(_serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by master + components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by master + components. + :vartype tenant_id: str + :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.v2024_03_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.v2024_03_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 + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "delegated_resources": {"key": "delegatedResources", "type": "{DelegatedResource}"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{ManagedServiceIdentityUserAssignedIdentitiesValue}", + }, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, + delegated_resources: Optional[Dict[str, "_models.DelegatedResource"]] = None, + user_assigned_identities: Optional[ + Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"] + ] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_03_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.v2024_03_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 + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.delegated_resources = delegated_resources + self.user_assigned_identities = user_assigned_identities + + +class ManagedClusterIngressProfile(_serialization.Model): + """Ingress profile for the container service cluster. + + :ivar web_app_routing: Web App Routing settings for the ingress profile. + :vartype web_app_routing: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterIngressProfileWebAppRouting + """ + + _attribute_map = { + "web_app_routing": {"key": "webAppRouting", "type": "ManagedClusterIngressProfileWebAppRouting"}, + } + + def __init__( + self, *, web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = None, **kwargs: Any + ) -> None: + """ + :keyword web_app_routing: Web App Routing settings for the ingress profile. + :paramtype web_app_routing: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterIngressProfileWebAppRouting + """ + super().__init__(**kwargs) + self.web_app_routing = web_app_routing + + +class ManagedClusterIngressProfileWebAppRouting(_serialization.Model): # pylint: disable=name-too-long + """Web App Routing settings for the ingress profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar enabled: Whether to enable Web App Routing. + :vartype enabled: bool + :ivar dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the Web App + Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be + in different resource groups, but all public DNS zones must be in the same resource group and + all private DNS zones must be in the same resource group. + :vartype dns_zone_resource_ids: list[str] + :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.v2024_03_02_preview.models.UserAssignedIdentity + """ + + _validation = { + "dns_zone_resource_ids": {"max_items": 5, "min_items": 0}, + "identity": {"readonly": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "dns_zone_resource_ids": {"key": "dnsZoneResourceIds", "type": "[str]"}, + "identity": {"key": "identity", "type": "UserAssignedIdentity"}, + } + + def __init__( + self, *, enabled: Optional[bool] = None, dns_zone_resource_ids: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable Web App Routing. + :paramtype enabled: bool + :keyword dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the Web App + Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be + in different resource groups, but all public DNS zones must be in the same resource group and + all private DNS zones must be in the same resource group. + :paramtype dns_zone_resource_ids: list[str] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.dns_zone_resource_ids = dns_zone_resource_ids + self.identity = None + + +class ManagedClusterListResult(_serialization.Model): + """The response from the List Managed Clusters operation. + + 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.v2024_03_02_preview.models.ManagedCluster] + :ivar next_link: The URL to get the next set of managed cluster results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ManagedCluster]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_03_02_preview.models.ManagedCluster] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(_serialization.Model): + """Profile of the managed cluster load balancer. + + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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. + :vartype allocated_outbound_ports: int + :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 30 minutes. + :vartype idle_timeout_in_minutes: int + :ivar enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + cluster or not. + :vartype enable_multiple_standard_load_balancers: bool + :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.v2024_03_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.v2024_03_02_preview.models.ClusterServiceLoadBalancerHealthProbeMode + """ + + _validation = { + "allocated_outbound_ports": {"maximum": 64000, "minimum": 0}, + "idle_timeout_in_minutes": {"maximum": 120, "minimum": 4}, + } + + _attribute_map = { + "managed_outbound_i_ps": { + "key": "managedOutboundIPs", + "type": "ManagedClusterLoadBalancerProfileManagedOutboundIPs", + }, + "outbound_ip_prefixes": { + "key": "outboundIPPrefixes", + "type": "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + }, + "outbound_i_ps": {"key": "outboundIPs", "type": "ManagedClusterLoadBalancerProfileOutboundIPs"}, + "effective_outbound_i_ps": {"key": "effectiveOutboundIPs", "type": "[ResourceReference]"}, + "allocated_outbound_ports": {"key": "allocatedOutboundPorts", "type": "int"}, + "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, + "enable_multiple_standard_load_balancers": {"key": "enableMultipleStandardLoadBalancers", "type": "bool"}, + "backend_pool_type": {"key": "backendPoolType", "type": "str"}, + "cluster_service_load_balancer_health_probe_mode": { + "key": "clusterServiceLoadBalancerHealthProbeMode", + "type": "str", + }, + } + + def __init__( + self, + *, + managed_outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileManagedOutboundIPs"] = None, + outbound_ip_prefixes: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes"] = None, + outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPs"] = None, + effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None, + allocated_outbound_ports: int = 0, + idle_timeout_in_minutes: int = 30, + enable_multiple_standard_load_balancers: Optional[bool] = None, + backend_pool_type: Union[str, "_models.BackendPoolType"] = "NodeIPConfiguration", + cluster_service_load_balancer_health_probe_mode: Union[ + str, "_models.ClusterServiceLoadBalancerHealthProbeMode" + ] = "ServiceNodePort", + **kwargs: Any + ) -> None: + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ResourceReference] + :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. + :paramtype allocated_outbound_ports: int + :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 30 minutes. + :paramtype idle_timeout_in_minutes: int + :keyword enable_multiple_standard_load_balancers: Enable multiple standard load balancers per + AKS cluster or not. + :paramtype enable_multiple_standard_load_balancers: bool + :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.v2024_03_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.v2024_03_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 = effective_outbound_i_ps + 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 + self.backend_pool_type = backend_pool_type + self.cluster_service_load_balancer_health_probe_mode = cluster_service_load_balancer_health_probe_mode + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(_serialization.Model): # pylint: disable=name-too-long + """Desired managed outbound IPs for the cluster load balancer. + + :ivar count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :vartype count: int + :ivar count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :vartype count_ipv6: int + """ + + _validation = { + "count": {"maximum": 100, "minimum": 1}, + "count_ipv6": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + "count_ipv6": {"key": "countIPv6", "type": "int"}, + } + + def __init__(self, *, count: int = 1, count_ipv6: int = 0, **kwargs: Any) -> None: + """ + :keyword count: The desired number of IPv4 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 1. + :paramtype count: int + :keyword count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :paramtype count_ipv6: int + """ + super().__init__(**kwargs) + self.count = count + self.count_ipv6 = count_ipv6 + + +class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(_serialization.Model): # pylint: disable=name-too-long + """Desired outbound IP Prefix resources for the cluster load balancer. + + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ResourceReference] + """ + + _attribute_map = { + "public_ip_prefixes": {"key": "publicIPPrefixes", "type": "[ResourceReference]"}, + } + + def __init__( + self, *, public_ip_prefixes: Optional[List["_models.ResourceReference"]] = None, **kwargs: Any + ) -> None: + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ResourceReference] + """ + super().__init__(**kwargs) + self.public_ip_prefixes = public_ip_prefixes + + +class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): # pylint: disable=name-too-long + """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.v2024_03_02_preview.models.ResourceReference] + """ + + _attribute_map = { + "public_i_ps": {"key": "publicIPs", "type": "[ResourceReference]"}, + } + + 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.v2024_03_02_preview.models.ResourceReference] + """ + super().__init__(**kwargs) + self.public_i_ps = public_i_ps + + +class ManagedClusterManagedOutboundIPProfile(_serialization.Model): + """Profile of the managed outbound IP resources of the managed cluster. + + :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must + be in the range of 1 to 16 (inclusive). The default value is 1. + :vartype count: int + """ + + _validation = { + "count": {"maximum": 16, "minimum": 1}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, count: int = 1, **kwargs: Any) -> None: + """ + :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values + must be in the range of 1 to 16 (inclusive). The default value is 1. + :paramtype count: int + """ + super().__init__(**kwargs) + self.count = count + + +class ManagedClusterMetricsProfile(_serialization.Model): + """The metrics profile for the ManagedCluster. + + :ivar cost_analysis: The cost analysis configuration for the cluster. + :vartype cost_analysis: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterCostAnalysis + """ + + _attribute_map = { + "cost_analysis": {"key": "costAnalysis", "type": "ManagedClusterCostAnalysis"}, + } + + def __init__(self, *, cost_analysis: Optional["_models.ManagedClusterCostAnalysis"] = None, **kwargs: Any) -> None: + """ + :keyword cost_analysis: The cost analysis configuration for the cluster. + :paramtype cost_analysis: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterCostAnalysis + """ + super().__init__(**kwargs) + self.cost_analysis = cost_analysis + + +class ManagedClusterNATGatewayProfile(_serialization.Model): + """Profile of the managed cluster NAT gateway. + + :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.v2024_03_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.v2024_03_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 + """ + + _validation = { + "idle_timeout_in_minutes": {"maximum": 120, "minimum": 4}, + } + + _attribute_map = { + "managed_outbound_ip_profile": { + "key": "managedOutboundIPProfile", + "type": "ManagedClusterManagedOutboundIPProfile", + }, + "effective_outbound_i_ps": {"key": "effectiveOutboundIPs", "type": "[ResourceReference]"}, + "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, + } + + def __init__( + self, + *, + managed_outbound_ip_profile: Optional["_models.ManagedClusterManagedOutboundIPProfile"] = None, + effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None, + idle_timeout_in_minutes: int = 4, + **kwargs: Any + ) -> None: + """ + :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.v2024_03_02_preview.models.ManagedClusterManagedOutboundIPProfile + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT + gateway. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ResourceReference] + :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 = effective_outbound_i_ps + self.idle_timeout_in_minutes = idle_timeout_in_minutes + + +class ManagedClusterNodeProvisioningProfile(_serialization.Model): + """ManagedClusterNodeProvisioningProfile. + + :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.v2024_03_02_preview.models.NodeProvisioningMode + """ + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + } + + def __init__(self, *, mode: Optional[Union[str, "_models.NodeProvisioningMode"]] = None, **kwargs: Any) -> None: + """ + :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.v2024_03_02_preview.models.NodeProvisioningMode + """ + super().__init__(**kwargs) + self.mode = mode + + +class ManagedClusterNodeResourceGroupProfile(_serialization.Model): + """Node resource group lockdown profile for a managed cluster. + + :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.v2024_03_02_preview.models.RestrictionLevel + """ + + _attribute_map = { + "restriction_level": {"key": "restrictionLevel", "type": "str"}, + } + + def __init__( + self, *, restriction_level: Optional[Union[str, "_models.RestrictionLevel"]] = None, **kwargs: Any + ) -> None: + """ + :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.v2024_03_02_preview.models.RestrictionLevel + """ + super().__init__(**kwargs) + self.restriction_level = restriction_level + + +class ManagedClusterOIDCIssuerProfile(_serialization.Model): + """The OIDC issuer profile of the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar issuer_url: The OIDC issuer url of the Managed Cluster. + :vartype issuer_url: str + :ivar enabled: Whether the OIDC issuer is enabled. + :vartype enabled: bool + """ + + _validation = { + "issuer_url": {"readonly": True}, + } + + _attribute_map = { + "issuer_url": {"key": "issuerURL", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether the OIDC issuer is enabled. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.issuer_url = None + self.enabled = enabled + + +class ManagedClusterPodIdentity(_serialization.Model): + """Details about the pod identity assigned to the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the pod identity. Required. + :vartype name: str + :ivar namespace: The namespace of the pod identity. Required. + :vartype namespace: str + :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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityProvisioningInfo + """ + + _validation = { + "name": {"required": True}, + "namespace": {"required": True}, + "identity": {"required": True}, + "provisioning_state": {"readonly": True}, + "provisioning_info": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "binding_selector": {"key": "bindingSelector", "type": "str"}, + "identity": {"key": "identity", "type": "UserAssignedIdentity"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "provisioning_info": {"key": "provisioningInfo", "type": "ManagedClusterPodIdentityProvisioningInfo"}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + identity: "_models.UserAssignedIdentity", + binding_selector: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the pod identity. Required. + :paramtype name: str + :keyword namespace: The namespace of the pod identity. Required. + :paramtype namespace: str + :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.v2024_03_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 + + +class ManagedClusterPodIdentityException(_serialization.Model): + """See `disable AAD Pod Identity for a specific Pod/Application + `_ for more + details. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the pod identity exception. Required. + :vartype name: str + :ivar namespace: The namespace of the pod identity exception. Required. + :vartype namespace: str + :ivar pod_labels: The pod labels to match. Required. + :vartype pod_labels: dict[str, str] + """ + + _validation = { + "name": {"required": True}, + "namespace": {"required": True}, + "pod_labels": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "pod_labels": {"key": "podLabels", "type": "{str}"}, + } + + def __init__(self, *, name: str, namespace: str, pod_labels: Dict[str, str], **kwargs: Any) -> None: + """ + :keyword name: The name of the pod identity exception. Required. + :paramtype name: str + :keyword namespace: The namespace of the pod identity exception. Required. + :paramtype namespace: str + :keyword pod_labels: The pod labels to match. Required. + :paramtype pod_labels: dict[str, str] + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.pod_labels = pod_labels + + +class ManagedClusterPodIdentityProfile(_serialization.Model): + """See `use AAD pod identity `_ + for more details on pod identity integration. + + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :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.v2024_03_02_preview.models.ManagedClusterPodIdentity] + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityException] + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "allow_network_plugin_kubenet": {"key": "allowNetworkPluginKubenet", "type": "bool"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "[ManagedClusterPodIdentity]"}, + "user_assigned_identity_exceptions": { + "key": "userAssignedIdentityExceptions", + "type": "[ManagedClusterPodIdentityException]", + }, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + allow_network_plugin_kubenet: Optional[bool] = None, + user_assigned_identities: Optional[List["_models.ManagedClusterPodIdentity"]] = None, + user_assigned_identity_exceptions: Optional[List["_models.ManagedClusterPodIdentityException"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :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.v2024_03_02_preview.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityException] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.allow_network_plugin_kubenet = allow_network_plugin_kubenet + self.user_assigned_identities = user_assigned_identities + self.user_assigned_identity_exceptions = user_assigned_identity_exceptions + + +class ManagedClusterPodIdentityProvisioningError(_serialization.Model): # pylint: disable=name-too-long + """An error response from the pod identity provisioning. + + :ivar error: Details about the error. + :vartype error: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningErrorBody"}, + } + + def __init__( + self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs: Any + ) -> None: + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + super().__init__(**kwargs) + self.error = error + + +class ManagedClusterPodIdentityProvisioningErrorBody(_serialization.Model): # pylint: disable=name-too-long + """An error response from the pod identity provisioning. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ManagedClusterPodIdentityProvisioningErrorBody]"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.ManagedClusterPodIdentityProvisioningErrorBody"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ManagedClusterPodIdentityProvisioningInfo(_serialization.Model): # pylint: disable=name-too-long + """ManagedClusterPodIdentityProvisioningInfo. + + :ivar error: Pod identity assignment error (if any). + :vartype error: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningError"}, + } + + def __init__( + self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = None, **kwargs: Any + ) -> None: + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPodIdentityProvisioningError + """ + super().__init__(**kwargs) + self.error = error + + +class ManagedClusterPoolUpgradeProfile(_serialization.Model): + """The list of available upgrade versions. + + All required parameters must be populated in order to send to server. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :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.v2024_03_02_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + + _validation = { + "kubernetes_version": {"required": True}, + "os_type": {"required": True}, + } + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "os_type": {"key": "osType", "type": "str"}, + "upgrades": {"key": "upgrades", "type": "[ManagedClusterPoolUpgradeProfileUpgradesItem]"}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "_models.OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["_models.ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :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.v2024_03_02_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.name = name + self.os_type = os_type + self.upgrades = upgrades + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(_serialization.Model): # pylint: disable=name-too-long + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, *, kubernetes_version: Optional[str] = None, is_preview: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class ManagedClusterPropertiesAutoScalerProfile( + _serialization.Model +): # pylint: disable=too-many-instance-attributes,name-too-long + """Parameters to be applied to the cluster-autoscaler when enabled. + + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar daemonset_eviction_for_empty_nodes: If set to true, all daemonset pods on empty nodes + will be evicted before deletion of the node. If the daemonset pod cannot be evicted another + node will be chosen for scaling. If set to false, the node will be deleted without ensuring + that daemonset pods are deleted or evicted. + :vartype daemonset_eviction_for_empty_nodes: bool + :ivar daemonset_eviction_for_occupied_nodes: If set to true, all daemonset pods on occupied + nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted + another node will be chosen for scaling. If set to false, the node will be deleted without + ensuring that daemonset pods are deleted or evicted. + :vartype daemonset_eviction_for_occupied_nodes: bool + :ivar ignore_daemonsets_utilization: If set to true, the resources used by daemonset will be + taken into account when making scaling down decisions. + :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.v2024_03_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. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str + """ + + _attribute_map = { + "balance_similar_node_groups": {"key": "balance-similar-node-groups", "type": "str"}, + "daemonset_eviction_for_empty_nodes": {"key": "daemonset-eviction-for-empty-nodes", "type": "bool"}, + "daemonset_eviction_for_occupied_nodes": {"key": "daemonset-eviction-for-occupied-nodes", "type": "bool"}, + "ignore_daemonsets_utilization": {"key": "ignore-daemonsets-utilization", "type": "bool"}, + "expander": {"key": "expander", "type": "str"}, + "max_empty_bulk_delete": {"key": "max-empty-bulk-delete", "type": "str"}, + "max_graceful_termination_sec": {"key": "max-graceful-termination-sec", "type": "str"}, + "max_node_provision_time": {"key": "max-node-provision-time", "type": "str"}, + "max_total_unready_percentage": {"key": "max-total-unready-percentage", "type": "str"}, + "new_pod_scale_up_delay": {"key": "new-pod-scale-up-delay", "type": "str"}, + "ok_total_unready_count": {"key": "ok-total-unready-count", "type": "str"}, + "scan_interval": {"key": "scan-interval", "type": "str"}, + "scale_down_delay_after_add": {"key": "scale-down-delay-after-add", "type": "str"}, + "scale_down_delay_after_delete": {"key": "scale-down-delay-after-delete", "type": "str"}, + "scale_down_delay_after_failure": {"key": "scale-down-delay-after-failure", "type": "str"}, + "scale_down_unneeded_time": {"key": "scale-down-unneeded-time", "type": "str"}, + "scale_down_unready_time": {"key": "scale-down-unready-time", "type": "str"}, + "scale_down_utilization_threshold": {"key": "scale-down-utilization-threshold", "type": "str"}, + "skip_nodes_with_local_storage": {"key": "skip-nodes-with-local-storage", "type": "str"}, + "skip_nodes_with_system_pods": {"key": "skip-nodes-with-system-pods", "type": "str"}, + } + + def __init__( + self, + *, + balance_similar_node_groups: Optional[str] = None, + daemonset_eviction_for_empty_nodes: Optional[bool] = None, + daemonset_eviction_for_occupied_nodes: Optional[bool] = None, + ignore_daemonsets_utilization: Optional[bool] = None, + expander: Optional[Union[str, "_models.Expander"]] = None, + max_empty_bulk_delete: Optional[str] = None, + max_graceful_termination_sec: Optional[str] = None, + max_node_provision_time: Optional[str] = None, + max_total_unready_percentage: Optional[str] = None, + new_pod_scale_up_delay: Optional[str] = None, + ok_total_unready_count: Optional[str] = None, + scan_interval: Optional[str] = None, + scale_down_delay_after_add: Optional[str] = None, + scale_down_delay_after_delete: Optional[str] = None, + scale_down_delay_after_failure: Optional[str] = None, + scale_down_unneeded_time: Optional[str] = None, + scale_down_unready_time: Optional[str] = None, + scale_down_utilization_threshold: Optional[str] = None, + skip_nodes_with_local_storage: Optional[str] = None, + skip_nodes_with_system_pods: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword daemonset_eviction_for_empty_nodes: If set to true, all daemonset pods on empty nodes + will be evicted before deletion of the node. If the daemonset pod cannot be evicted another + node will be chosen for scaling. If set to false, the node will be deleted without ensuring + that daemonset pods are deleted or evicted. + :paramtype daemonset_eviction_for_empty_nodes: bool + :keyword daemonset_eviction_for_occupied_nodes: If set to true, all daemonset pods on occupied + nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted + another node will be chosen for scaling. If set to false, the node will be deleted without + ensuring that daemonset pods are deleted or evicted. + :paramtype daemonset_eviction_for_occupied_nodes: bool + :keyword ignore_daemonsets_utilization: If set to true, the resources used by daemonset will be + taken into account when making scaling down decisions. + :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.v2024_03_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. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ + super().__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + self.daemonset_eviction_for_empty_nodes = daemonset_eviction_for_empty_nodes + self.daemonset_eviction_for_occupied_nodes = daemonset_eviction_for_occupied_nodes + self.ignore_daemonsets_utilization = ignore_daemonsets_utilization + self.expander = expander + self.max_empty_bulk_delete = max_empty_bulk_delete + self.max_graceful_termination_sec = max_graceful_termination_sec + self.max_node_provision_time = max_node_provision_time + self.max_total_unready_percentage = max_total_unready_percentage + self.new_pod_scale_up_delay = new_pod_scale_up_delay + self.ok_total_unready_count = ok_total_unready_count + self.scan_interval = scan_interval + self.scale_down_delay_after_add = scale_down_delay_after_add + self.scale_down_delay_after_delete = scale_down_delay_after_delete + self.scale_down_delay_after_failure = scale_down_delay_after_failure + self.scale_down_unneeded_time = scale_down_unneeded_time + self.scale_down_unready_time = scale_down_unready_time + self.scale_down_utilization_threshold = scale_down_utilization_threshold + self.skip_nodes_with_local_storage = skip_nodes_with_local_storage + self.skip_nodes_with_system_pods = skip_nodes_with_system_pods + + +class ManagedClusterPropertiesForSnapshot(_serialization.Model): + """managed cluster properties for snapshot, these properties are read only. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kubernetes_version: The current kubernetes version. + :vartype kubernetes_version: str + :ivar sku: The current managed cluster sku. + :vartype sku: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.NetworkProfileForSnapshot + """ + + _validation = { + "network_profile": {"readonly": True}, + } + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "sku": {"key": "sku", "type": "ManagedClusterSKU"}, + "enable_rbac": {"key": "enableRbac", "type": "bool"}, + "network_profile": {"key": "networkProfile", "type": "NetworkProfileForSnapshot"}, + } + + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + sku: Optional["_models.ManagedClusterSKU"] = None, + enable_rbac: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The current kubernetes version. + :paramtype kubernetes_version: str + :keyword sku: The current managed cluster sku. + :paramtype sku: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSKU + :keyword enable_rbac: Whether the cluster has enabled Kubernetes Role-Based Access Control or + not. + :paramtype enable_rbac: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.sku = sku + self.enable_rbac = enable_rbac + self.network_profile = None + + +class ManagedClusterSecurityProfile(_serialization.Model): + """Security profile for the container service cluster. + + :ivar defender: Microsoft Defender settings for the security profile. + :vartype defender: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + :ivar image_cleaner: Image Cleaner settings for the security profile. + :vartype image_cleaner: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSecurityProfileImageIntegrity + :ivar node_restriction: `Node Restriction + `_ + settings for the security profile. + :vartype node_restriction: + ~azure.mgmt.containerservice.v2024_03_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 nodes with the Custom CA Trust feature enabled. For more information see + `Custom CA Trust Certificates + `_. + :vartype custom_ca_trust_certificates: list[bytes] + """ + + _validation = { + "custom_ca_trust_certificates": {"max_items": 10, "min_items": 0}, + } + + _attribute_map = { + "defender": {"key": "defender", "type": "ManagedClusterSecurityProfileDefender"}, + "azure_key_vault_kms": {"key": "azureKeyVaultKms", "type": "AzureKeyVaultKms"}, + "workload_identity": {"key": "workloadIdentity", "type": "ManagedClusterSecurityProfileWorkloadIdentity"}, + "image_cleaner": {"key": "imageCleaner", "type": "ManagedClusterSecurityProfileImageCleaner"}, + "image_integrity": {"key": "imageIntegrity", "type": "ManagedClusterSecurityProfileImageIntegrity"}, + "node_restriction": {"key": "nodeRestriction", "type": "ManagedClusterSecurityProfileNodeRestriction"}, + "custom_ca_trust_certificates": {"key": "customCATrustCertificates", "type": "[bytearray]"}, + } + + def __init__( + self, + *, + defender: Optional["_models.ManagedClusterSecurityProfileDefender"] = None, + azure_key_vault_kms: Optional["_models.AzureKeyVaultKms"] = None, + workload_identity: Optional["_models.ManagedClusterSecurityProfileWorkloadIdentity"] = None, + image_cleaner: Optional["_models.ManagedClusterSecurityProfileImageCleaner"] = None, + image_integrity: Optional["_models.ManagedClusterSecurityProfileImageIntegrity"] = None, + node_restriction: Optional["_models.ManagedClusterSecurityProfileNodeRestriction"] = None, + custom_ca_trust_certificates: Optional[List[bytes]] = None, + **kwargs: Any + ) -> None: + """ + :keyword defender: Microsoft Defender settings for the security profile. + :paramtype defender: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + :keyword image_cleaner: Image Cleaner settings for the security profile. + :paramtype image_cleaner: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSecurityProfileImageIntegrity + :keyword node_restriction: `Node Restriction + `_ + settings for the security profile. + :paramtype node_restriction: + ~azure.mgmt.containerservice.v2024_03_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 nodes with the Custom CA Trust feature enabled. For more information see + `Custom CA Trust Certificates + `_. + :paramtype custom_ca_trust_certificates: list[bytes] + """ + super().__init__(**kwargs) + self.defender = defender + self.azure_key_vault_kms = azure_key_vault_kms + self.workload_identity = workload_identity + self.image_cleaner = image_cleaner + self.image_integrity = image_integrity + self.node_restriction = node_restriction + self.custom_ca_trust_certificates = custom_ca_trust_certificates + + +class ManagedClusterSecurityProfileDefender(_serialization.Model): + """Microsoft Defender settings for the security profile. + + :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required + and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + empty. + :vartype log_analytics_workspace_resource_id: str + :ivar security_monitoring: Microsoft Defender threat detection for Cloud settings for the + security profile. + :vartype security_monitoring: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + """ + + _attribute_map = { + "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, + "security_monitoring": { + "key": "securityMonitoring", + "type": "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + }, + } + + def __init__( + self, + *, + log_analytics_workspace_resource_id: Optional[str] = None, + security_monitoring: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityMonitoring"] = None, + **kwargs: Any + ) -> None: + """ + :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required + and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + empty. + :paramtype log_analytics_workspace_resource_id: str + :keyword security_monitoring: Microsoft Defender threat detection for Cloud settings for the + security profile. + :paramtype security_monitoring: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + """ + super().__init__(**kwargs) + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + self.security_monitoring = security_monitoring + + +class ManagedClusterSecurityProfileDefenderSecurityMonitoring(_serialization.Model): # pylint: disable=name-too-long + """Microsoft Defender settings for the security profile threat detection. + + :ivar enabled: Whether to enable Defender threat detection. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Defender threat detection. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileImageCleaner(_serialization.Model): # pylint: disable=name-too-long + """Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce + attack surface area. Here are settings for the security profile. + + :ivar enabled: Whether to enable Image Cleaner on AKS cluster. + :vartype enabled: bool + :ivar interval_hours: Image Cleaner scanning interval in hours. + :vartype interval_hours: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "interval_hours": {"key": "intervalHours", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, interval_hours: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Image Cleaner on AKS cluster. + :paramtype enabled: bool + :keyword interval_hours: Image Cleaner scanning interval in hours. + :paramtype interval_hours: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.interval_hours = interval_hours + + +class ManagedClusterSecurityProfileImageIntegrity(_serialization.Model): # pylint: disable=name-too-long + """Image integrity related settings for the security profile. + + :ivar enabled: Whether to enable image integrity. The default value is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable image integrity. The default value is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileNodeRestriction(_serialization.Model): # pylint: disable=name-too-long + """Node Restriction settings for the security profile. + + :ivar enabled: Whether to enable Node Restriction. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Node Restriction. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileWorkloadIdentity(_serialization.Model): # pylint: disable=name-too-long + """Workload identity settings for the security profile. + + :ivar enabled: Whether to enable workload identity. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable workload identity. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterServicePrincipalProfile(_serialization.Model): + """Information about a service principal identity for the cluster to use for manipulating Azure + APIs. + + All required parameters must be populated in order to send to server. + + :ivar client_id: The ID for the service principal. Required. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str + """ + + _validation = { + "client_id": {"required": True}, + } + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + "secret": {"key": "secret", "type": "str"}, + } + + def __init__(self, *, client_id: str, secret: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword client_id: The ID for the service principal. Required. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ + super().__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +class ManagedClusterSKU(_serialization.Model): + """The SKU of a Managed Cluster. + + :ivar name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". + :vartype name: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSKUTier + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "_models.ManagedClusterSKUTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". + :paramtype name: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSKUTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + +class ManagedClusterSnapshot(TrackedResource): + """A managed cluster snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.ManagedClusterPropertiesForSnapshot + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "managed_cluster_properties_read_only": {"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}"}, + "location": {"key": "location", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "snapshot_type": {"key": "properties.snapshotType", "type": "str"}, + "managed_cluster_properties_read_only": { + "key": "properties.managedClusterPropertiesReadOnly", + "type": "ManagedClusterPropertiesForSnapshot", + }, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["_models.CreationData"] = None, + snapshot_type: Union[str, "_models.SnapshotType"] = "NodePool", + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :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.v2024_03_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.v2024_03_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 + + +class ManagedClusterSnapshotListResult(_serialization.Model): + """The response from the List Managed Cluster Snapshots operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of managed cluster snapshots. + :vartype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot] + :ivar next_link: The URL to get the next set of managed cluster snapshot results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ManagedClusterSnapshot]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ManagedClusterSnapshot"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of managed cluster snapshots. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterStaticEgressGatewayProfile(_serialization.Model): + """The Static Egress Gateway addon configuration for the cluster. + + :ivar enabled: Indicates if Static Egress Gateway addon is enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Static Egress Gateway addon is enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfile(_serialization.Model): + """Storage profile for the container service cluster. + + :ivar disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. + :vartype disk_csi_driver: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + :ivar file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :vartype file_csi_driver: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + :ivar snapshot_controller: Snapshot Controller settings for the storage profile. + :vartype snapshot_controller: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfileSnapshotController + :ivar blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :vartype blob_csi_driver: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver + """ + + _attribute_map = { + "disk_csi_driver": {"key": "diskCSIDriver", "type": "ManagedClusterStorageProfileDiskCSIDriver"}, + "file_csi_driver": {"key": "fileCSIDriver", "type": "ManagedClusterStorageProfileFileCSIDriver"}, + "snapshot_controller": {"key": "snapshotController", "type": "ManagedClusterStorageProfileSnapshotController"}, + "blob_csi_driver": {"key": "blobCSIDriver", "type": "ManagedClusterStorageProfileBlobCSIDriver"}, + } + + def __init__( + self, + *, + disk_csi_driver: Optional["_models.ManagedClusterStorageProfileDiskCSIDriver"] = None, + file_csi_driver: Optional["_models.ManagedClusterStorageProfileFileCSIDriver"] = None, + snapshot_controller: Optional["_models.ManagedClusterStorageProfileSnapshotController"] = None, + blob_csi_driver: Optional["_models.ManagedClusterStorageProfileBlobCSIDriver"] = None, + **kwargs: Any + ) -> None: + """ + :keyword disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. + :paramtype disk_csi_driver: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + :keyword file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :paramtype file_csi_driver: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + :keyword snapshot_controller: Snapshot Controller settings for the storage profile. + :paramtype snapshot_controller: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfileSnapshotController + :keyword blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :paramtype blob_csi_driver: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver + """ + super().__init__(**kwargs) + self.disk_csi_driver = disk_csi_driver + self.file_csi_driver = file_csi_driver + self.snapshot_controller = snapshot_controller + self.blob_csi_driver = blob_csi_driver + + +class ManagedClusterStorageProfileBlobCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureBlob CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureBlob CSI Driver. The default value is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureBlob CSI Driver. The default value is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfileDiskCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureDisk CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureDisk CSI Driver. The default value is true. + :vartype enabled: bool + :ivar version: The version of AzureDisk CSI Driver. The default value is v1. + :vartype version: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, version: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureDisk CSI Driver. The default value is true. + :paramtype enabled: bool + :keyword version: The version of AzureDisk CSI Driver. The default value is v1. + :paramtype version: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.version = version + + +class ManagedClusterStorageProfileFileCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureFile CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureFile CSI Driver. The default value is true. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureFile CSI Driver. The default value is true. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfileSnapshotController(_serialization.Model): # pylint: disable=name-too-long + """Snapshot Controller settings for the storage profile. + + :ivar enabled: Whether to enable Snapshot Controller. The default value is true. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Snapshot Controller. The default value is true. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterUpgradeProfile(_serialization.Model): + """The list of available upgrades for compute pools. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the upgrade profile. + :vartype id: str + :ivar name: The name of the upgrade profile. + :vartype name: str + :ivar type: The type of the upgrade profile. + :vartype type: str + :ivar control_plane_profile: The list of available upgrade versions for the control plane. + Required. + :vartype control_plane_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterPoolUpgradeProfile] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "control_plane_profile": {"required": True}, + "agent_pool_profiles": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "control_plane_profile": {"key": "properties.controlPlaneProfile", "type": "ManagedClusterPoolUpgradeProfile"}, + "agent_pool_profiles": {"key": "properties.agentPoolProfiles", "type": "[ManagedClusterPoolUpgradeProfile]"}, + } + + def __init__( + self, + *, + control_plane_profile: "_models.ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["_models.ManagedClusterPoolUpgradeProfile"], + **kwargs: Any + ) -> None: + """ + :keyword control_plane_profile: The list of available upgrade versions for the control plane. + Required. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterPoolUpgradeProfile] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.control_plane_profile = control_plane_profile + self.agent_pool_profiles = agent_pool_profiles + + +class ManagedClusterWindowsProfile(_serialization.Model): + """Profile for Windows VMs in the managed cluster. + + All required parameters must be populated in order to send to server. + + :ivar admin_username: Specifies the name of the administrator account. :code:`
`:code:`
` + **Restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** + "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", + "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character + :code:`
`:code:`
` **Max-length:** 20 characters. Required. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :vartype admin_password: str + :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.v2024_03_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.v2024_03_02_preview.models.WindowsGmsaProfile + """ + + _validation = { + "admin_username": {"required": True}, + } + + _attribute_map = { + "admin_username": {"key": "adminUsername", "type": "str"}, + "admin_password": {"key": "adminPassword", "type": "str"}, + "license_type": {"key": "licenseType", "type": "str"}, + "enable_csi_proxy": {"key": "enableCSIProxy", "type": "bool"}, + "gmsa_profile": {"key": "gmsaProfile", "type": "WindowsGmsaProfile"}, + } + + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + license_type: Optional[Union[str, "_models.LicenseType"]] = None, + enable_csi_proxy: Optional[bool] = None, + gmsa_profile: Optional["_models.WindowsGmsaProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword admin_username: Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. Required. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :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.v2024_03_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.v2024_03_02_preview.models.WindowsGmsaProfile + """ + super().__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + self.license_type = license_type + self.enable_csi_proxy = enable_csi_proxy + self.gmsa_profile = gmsa_profile + + +class ManagedClusterWorkloadAutoScalerProfile(_serialization.Model): + """Workload Auto-scaler profile for the managed cluster. + + :ivar keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :vartype keda: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + :ivar vertical_pod_autoscaler: + :vartype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler # pylint: disable=line-too-long + """ + + _attribute_map = { + "keda": {"key": "keda", "type": "ManagedClusterWorkloadAutoScalerProfileKeda"}, + "vertical_pod_autoscaler": { + "key": "verticalPodAutoscaler", + "type": "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + }, + } + + def __init__( + self, + *, + keda: Optional["_models.ManagedClusterWorkloadAutoScalerProfileKeda"] = None, + vertical_pod_autoscaler: Optional[ + "_models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler" + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :paramtype keda: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + :keyword vertical_pod_autoscaler: + :paramtype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.keda = keda + self.vertical_pod_autoscaler = vertical_pod_autoscaler + + +class ManagedClusterWorkloadAutoScalerProfileKeda(_serialization.Model): # pylint: disable=name-too-long + """KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable KEDA. Required. + :vartype enabled: bool + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: bool, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable KEDA. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler( + _serialization.Model +): # pylint: disable=name-too-long + """ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable VPA add-on in cluster. Default value is false. Required. + :vartype enabled: bool + :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.v2024_03_02_preview.models.AddonAutoscaling + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "addon_autoscaling": {"key": "addonAutoscaling", "type": "str"}, + } + + def __init__( + self, + *, + enabled: bool = False, + addon_autoscaling: Union[str, "_models.AddonAutoscaling"] = "Disabled", + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable VPA add-on in cluster. Default value is false. Required. + :paramtype enabled: bool + :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.v2024_03_02_preview.models.AddonAutoscaling + """ + super().__init__(**kwargs) + self.enabled = enabled + self.addon_autoscaling = addon_autoscaling + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(_serialization.Model): # pylint: disable=name-too-long + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class ManualScaleProfile(_serialization.Model): + """Specifications on number of machines. + + :ivar sizes: The list of allowed vm sizes. 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 count: Number of nodes. + :vartype count: int + """ + + _validation = { + "count": {"maximum": 1000, "minimum": 0}, + } + + _attribute_map = { + "sizes": {"key": "sizes", "type": "[str]"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, sizes: Optional[List[str]] = None, count: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword sizes: The list of allowed vm sizes. 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 count: Number of nodes. + :paramtype count: int + """ + super().__init__(**kwargs) + self.sizes = sizes + self.count = count + + +class MeshRevision(_serialization.Model): + """Holds information on upgrades and compatibility for given major.minor mesh release. + + :ivar revision: The revision of the mesh release. + :vartype revision: str + :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. + :vartype upgrades: list[str] + :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.v2024_03_02_preview.models.CompatibleVersions] + """ + + _attribute_map = { + "revision": {"key": "revision", "type": "str"}, + "upgrades": {"key": "upgrades", "type": "[str]"}, + "compatible_with": {"key": "compatibleWith", "type": "[CompatibleVersions]"}, + } + + def __init__( + self, + *, + revision: Optional[str] = None, + upgrades: Optional[List[str]] = None, + compatible_with: Optional[List["_models.CompatibleVersions"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword revision: The revision of the mesh release. + :paramtype revision: str + :keyword upgrades: List of revisions available for upgrade of a specific mesh revision. + :paramtype upgrades: list[str] + :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.v2024_03_02_preview.models.CompatibleVersions] + """ + super().__init__(**kwargs) + self.revision = revision + self.upgrades = upgrades + self.compatible_with = compatible_with + + +class MeshRevisionProfile(ProxyResource): + """Mesh revision profile for a mesh. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SystemData + :ivar properties: Mesh revision profile properties for a mesh. + :vartype properties: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshRevisionProfileProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "properties": {"key": "properties", "type": "MeshRevisionProfileProperties"}, + } + + def __init__(self, *, properties: Optional["_models.MeshRevisionProfileProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Mesh revision profile properties for a mesh. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshRevisionProfileProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class MeshRevisionProfileList(_serialization.Model): + """Holds an array of MeshRevisionsProfiles. + + 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.v2024_03_02_preview.models.MeshRevisionProfile] + :ivar next_link: The URL to get the next set of mesh revision profile. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MeshRevisionProfile]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_03_02_preview.models.MeshRevisionProfile] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MeshRevisionProfileProperties(_serialization.Model): + """Mesh revision profile properties for a mesh. + + :ivar mesh_revisions: + :vartype mesh_revisions: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshRevision] + """ + + _attribute_map = { + "mesh_revisions": {"key": "meshRevisions", "type": "[MeshRevision]"}, + } + + def __init__(self, *, mesh_revisions: Optional[List["_models.MeshRevision"]] = None, **kwargs: Any) -> None: + """ + :keyword mesh_revisions: + :paramtype mesh_revisions: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshRevision] + """ + super().__init__(**kwargs) + self.mesh_revisions = mesh_revisions + + +class MeshUpgradeProfile(ProxyResource): + """Upgrade profile for given mesh. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SystemData + :ivar properties: Mesh upgrade profile properties for a major.minor release. + :vartype properties: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshUpgradeProfileProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "properties": {"key": "properties", "type": "MeshUpgradeProfileProperties"}, + } + + def __init__(self, *, properties: Optional["_models.MeshUpgradeProfileProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Mesh upgrade profile properties for a major.minor release. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshUpgradeProfileProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class MeshUpgradeProfileList(_serialization.Model): + """Holds an array of MeshUpgradeProfiles. + + 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.v2024_03_02_preview.models.MeshUpgradeProfile] + :ivar next_link: The URL to get the next set of mesh upgrade profile. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MeshUpgradeProfile]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_03_02_preview.models.MeshUpgradeProfile] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MeshUpgradeProfileProperties(MeshRevision): + """Mesh upgrade profile properties for a major.minor release. + + :ivar revision: The revision of the mesh release. + :vartype revision: str + :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. + :vartype upgrades: list[str] + :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.v2024_03_02_preview.models.CompatibleVersions] + """ + + +class NetworkMonitoring(_serialization.Model): + """This addon can be used to configure network monitoring and generate network monitoring data in + Prometheus format. + + :ivar enabled: Enable or disable the network monitoring plugin on the cluster. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Enable or disable the network monitoring plugin on the cluster. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +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.v2024_03_02_preview.models.NetworkPlugin + :ivar network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" + :vartype network_plugin_mode: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.LoadBalancerSku + """ + + _attribute_map = { + "network_plugin": {"key": "networkPlugin", "type": "str"}, + "network_plugin_mode": {"key": "networkPluginMode", "type": "str"}, + "network_policy": {"key": "networkPolicy", "type": "str"}, + "network_mode": {"key": "networkMode", "type": "str"}, + "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, + } + + def __init__( + self, + *, + network_plugin: Union[str, "_models.NetworkPlugin"] = "kubenet", + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_plugin: networkPlugin for managed cluster snapshot. Known values are: "azure", + "kubenet", and "none". + :paramtype network_plugin: str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.NetworkPlugin + :keyword network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" + :paramtype network_plugin_mode: str or + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.LoadBalancerSku + """ + super().__init__(**kwargs) + self.network_plugin = network_plugin + self.network_plugin_mode = network_plugin_mode + self.network_policy = network_policy + self.network_mode = network_mode + self.load_balancer_sku = load_balancer_sku + + +class OperationListResult(_serialization.Model): + """The List Operation response. + + 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.v2024_03_02_preview.models.OperationValue] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OperationValue]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class OperationStatusResult(_serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ErrorDetail + """ + + _validation = { + "resource_id": {"readonly": True}, + "status": {"required": True}, + "percent_complete": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "percent_complete": {"key": "percentComplete", "type": "float"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "operations": {"key": "operations", "type": "[OperationStatusResult]"}, + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[List["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Operation status. Required. + :paramtype status: str + :keyword percent_complete: Percent of the operation that is complete. + :paramtype percent_complete: float + :keyword start_time: The start time of the operation. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the operation. + :paramtype end_time: ~datetime.datetime + :keyword operations: The operations list. + :paramtype operations: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.OperationStatusResult] + :keyword error: If present, details of the operation error. + :paramtype error: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ErrorDetail + """ + super().__init__(**kwargs) + self.id = id + self.resource_id = None + self.name = name + self.status = status + self.percent_complete = percent_complete + self.start_time = start_time + self.end_time = end_time + self.operations = operations + self.error = error + + +class OperationStatusResultList(_serialization.Model): + """The operations list. It contains an URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations. + :vartype value: + list[~azure.mgmt.containerservice.v2024_03_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 + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OperationStatusResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationValue(_serialization.Model): + """Describes the properties of a Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + "origin": {"readonly": True}, + "name": {"readonly": True}, + "operation": {"readonly": True}, + "resource": {"readonly": True}, + "description": {"readonly": True}, + "provider": {"readonly": True}, + } + + _attribute_map = { + "origin": {"key": "origin", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "operation": {"key": "display.operation", "type": "str"}, + "resource": {"key": "display.resource", "type": "str"}, + "description": {"key": "display.description", "type": "str"}, + "provider": {"key": "display.provider", "type": "str"}, + } + + 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 + + +class OSOptionProfile(_serialization.Model): + """The OS option profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the OS option resource. + :vartype id: str + :ivar name: The name of the OS option resource. + :vartype name: str + :ivar type: The type of the OS option resource. + :vartype type: str + :ivar os_option_property_list: The list of OS options. Required. + :vartype os_option_property_list: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.OSOptionProperty] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "os_option_property_list": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "os_option_property_list": {"key": "properties.osOptionPropertyList", "type": "[OSOptionProperty]"}, + } + + def __init__(self, *, os_option_property_list: List["_models.OSOptionProperty"], **kwargs: Any) -> None: + """ + :keyword os_option_property_list: The list of OS options. Required. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.OSOptionProperty] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.os_option_property_list = os_option_property_list + + +class OSOptionProperty(_serialization.Model): + """OS option property. + + All required parameters must be populated in order to send to server. + + :ivar os_type: The OS type. Required. + :vartype os_type: str + :ivar enable_fips_image: Whether the image is FIPS-enabled. Required. + :vartype enable_fips_image: bool + """ + + _validation = { + "os_type": {"required": True}, + "enable_fips_image": {"required": True}, + } + + _attribute_map = { + "os_type": {"key": "os-type", "type": "str"}, + "enable_fips_image": {"key": "enable-fips-image", "type": "bool"}, + } + + def __init__(self, *, os_type: str, enable_fips_image: bool, **kwargs: Any) -> None: + """ + :keyword os_type: The OS type. Required. + :paramtype os_type: str + :keyword enable_fips_image: Whether the image is FIPS-enabled. Required. + :paramtype enable_fips_image: bool + """ + super().__init__(**kwargs) + self.os_type = os_type + self.enable_fips_image = enable_fips_image + + +class OutboundEnvironmentEndpoint(_serialization.Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.EndpointDependency] + """ + + _attribute_map = { + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[EndpointDependency]"}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["_models.EndpointDependency"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.EndpointDependency] + """ + super().__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(_serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OutboundEnvironmentEndpoint]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.OutboundEnvironmentEndpoint"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.OutboundEnvironmentEndpoint] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class PortRange(_serialization.Model): + """The port range. + + :ivar port_start: The minimum port that is included in the range. It should be ranged from 1 to + 65535, and be less than or equal to portEnd. + :vartype port_start: int + :ivar port_end: The maximum port that is included in the range. It should be ranged from 1 to + 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.v2024_03_02_preview.models.Protocol + """ + + _validation = { + "port_start": {"maximum": 65535, "minimum": 1}, + "port_end": {"maximum": 65535, "minimum": 1}, + } + + _attribute_map = { + "port_start": {"key": "portStart", "type": "int"}, + "port_end": {"key": "portEnd", "type": "int"}, + "protocol": {"key": "protocol", "type": "str"}, + } + + def __init__( + self, + *, + port_start: Optional[int] = None, + port_end: Optional[int] = None, + protocol: Optional[Union[str, "_models.Protocol"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword port_start: The minimum port that is included in the range. It should be ranged from 1 + to 65535, and be less than or equal to portEnd. + :paramtype port_start: int + :keyword port_end: The maximum port that is included in the range. It should be ranged from 1 + 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.v2024_03_02_preview.models.Protocol + """ + super().__init__(**kwargs) + self.port_start = port_start + self.port_end = port_end + self.protocol = protocol + + +class PowerState(_serialization.Model): + """Describes the Power State of the cluster. + + :ivar code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and + "Stopped". + :vartype code: str or ~azure.mgmt.containerservice.v2024_03_02_preview.models.Code + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + } + + def __init__(self, *, code: Optional[Union[str, "_models.Code"]] = None, **kwargs: Any) -> None: + """ + :keyword code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and + "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2024_03_02_preview.models.Code + """ + super().__init__(**kwargs) + self.code = code + + +class PrivateEndpoint(_serialization.Model): + """Private endpoint which a connection belongs to. + + :ivar id: The resource ID of the private endpoint. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(_serialization.Model): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private endpoint connection. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar provisioning_state: The current provisioning state. Known values are: "Canceled", + "Creating", "Deleting", "Failed", and "Succeeded". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnectionProvisioningState + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.PrivateLinkServiceConnectionState + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + } + + def __init__( + self, + *, + private_endpoint: Optional["_models.PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, + **kwargs: Any + ) -> None: + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.PrivateLinkServiceConnectionState + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionListResult(_serialization.Model): + """A list of private endpoint connections. + + :ivar value: The collection value. + :vartype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnection] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnection] + """ + super().__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(_serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + _validation = { + "private_link_service_id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "group_id": {"key": "groupId", "type": "str"}, + "required_members": {"key": "requiredMembers", "type": "[str]"}, + "private_link_service_id": {"key": "privateLinkServiceID", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ + super().__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.group_id = group_id + self.required_members = required_members + self.private_link_service_id = None + + +class PrivateLinkResourcesListResult(_serialization.Model): + """A list of private link resources. + + :ivar value: The collection value. + :vartype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateLinkResource]"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateLinkResource] + """ + super().__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(_serialization.Model): + """The state of a private link service connection. + + :ivar status: The private link service connection status. Known values are: "Pending", + "Approved", "Rejected", and "Disconnected". + :vartype status: str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str + """ + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "_models.ConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword status: The private link service connection status. Known values are: "Pending", + "Approved", "Rejected", and "Disconnected". + :paramtype status: str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ + super().__init__(**kwargs) + self.status = status + self.description = description + + +class RebalanceLoadBalancersRequestBody(_serialization.Model): + """The names of the load balancers to rebalance. If set to empty, all load balancers will be + rebalanced. + + :ivar load_balancer_names: The load balancer names list. + :vartype load_balancer_names: list[str] + """ + + _attribute_map = { + "load_balancer_names": {"key": "loadBalancerNames", "type": "[str]"}, + } + + def __init__(self, *, load_balancer_names: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword load_balancer_names: The load balancer names list. + :paramtype load_balancer_names: list[str] + """ + super().__init__(**kwargs) + self.load_balancer_names = load_balancer_names + + +class RelativeMonthlySchedule(_serialization.Model): + """For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last + Friday'. + + All required parameters must be populated in order to send to server. + + :ivar interval_months: Specifies the number of months between each set of occurrences. + Required. + :vartype interval_months: int + :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.v2024_03_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.v2024_03_02_preview.models.WeekDay + """ + + _validation = { + "interval_months": {"required": True, "maximum": 6, "minimum": 1}, + "week_index": {"required": True}, + "day_of_week": {"required": True}, + } + + _attribute_map = { + "interval_months": {"key": "intervalMonths", "type": "int"}, + "week_index": {"key": "weekIndex", "type": "str"}, + "day_of_week": {"key": "dayOfWeek", "type": "str"}, + } + + def __init__( + self, + *, + interval_months: int, + week_index: Union[str, "_models.Type"], + day_of_week: Union[str, "_models.WeekDay"], + **kwargs: Any + ) -> None: + """ + :keyword interval_months: Specifies the number of months between each set of occurrences. + Required. + :paramtype interval_months: int + :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.v2024_03_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.v2024_03_02_preview.models.WeekDay + """ + super().__init__(**kwargs) + self.interval_months = interval_months + self.week_index = week_index + self.day_of_week = day_of_week + + +class ResourceReference(_serialization.Model): + """A reference to an Azure resource. + + :ivar id: The fully qualified Azure resource id. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class RunCommandRequest(_serialization.Model): + """A run command request. + + All required parameters must be populated in order to send to server. + + :ivar command: The command to run. Required. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str + """ + + _validation = { + "command": {"required": True}, + } + + _attribute_map = { + "command": {"key": "command", "type": "str"}, + "context": {"key": "context", "type": "str"}, + "cluster_token": {"key": "clusterToken", "type": "str"}, + } + + def __init__( + self, *, command: str, context: Optional[str] = None, cluster_token: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword command: The command to run. Required. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ + super().__init__(**kwargs) + self.command = command + self.context = context + self.cluster_token = cluster_token + + +class RunCommandResult(_serialization.Model): + """run command result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The command id. + :vartype id: str + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + _validation = { + "id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "exit_code": {"readonly": True}, + "started_at": {"readonly": True}, + "finished_at": {"readonly": True}, + "logs": {"readonly": True}, + "reason": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "exit_code": {"key": "properties.exitCode", "type": "int"}, + "started_at": {"key": "properties.startedAt", "type": "iso-8601"}, + "finished_at": {"key": "properties.finishedAt", "type": "iso-8601"}, + "logs": {"key": "properties.logs", "type": "str"}, + "reason": {"key": "properties.reason", "type": "str"}, + } + + 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 + + +class SafeguardsAvailableVersion(Resource): + """Available Safeguards Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SystemData + :ivar properties: Whether the version is default or not and support info. Required. + :vartype properties: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.SafeguardsAvailableVersionsProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "SafeguardsAvailableVersionsProperties"}, + } + + def __init__(self, *, properties: "_models.SafeguardsAvailableVersionsProperties", **kwargs: Any) -> None: + """ + :keyword properties: Whether the version is default or not and support info. Required. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.SafeguardsAvailableVersionsProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class SafeguardsAvailableVersionsList(_serialization.Model): + """Hold values properties, which is array of SafeguardsVersions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of AKS supported Safeguards versions. + :vartype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.SafeguardsAvailableVersion] + :ivar next_link: The URL to get the next Safeguards available version. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[SafeguardsAvailableVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.SafeguardsAvailableVersion"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Array of AKS supported Safeguards versions. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.SafeguardsAvailableVersion] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class SafeguardsAvailableVersionsProperties(_serialization.Model): + """Whether the version is default or not and support info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_default_version: + :vartype is_default_version: bool + :ivar support: Whether the version is preview or stable. Known values are: "Preview" and + "Stable". + :vartype support: str or + ~azure.mgmt.containerservice.v2024_03_02_preview.models.SafeguardsSupport + """ + + _validation = { + "is_default_version": {"readonly": True}, + "support": {"readonly": True}, + } + + _attribute_map = { + "is_default_version": {"key": "isDefaultVersion", "type": "bool"}, + "support": {"key": "support", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.is_default_version = None + self.support = None + + +class SafeguardsProfile(_serialization.Model): + """The Safeguards profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar system_excluded_namespaces: List of namespaces specified by AKS to be excluded from + Safeguards. + :vartype system_excluded_namespaces: list[str] + :ivar version: The version of constraints to use. + :vartype version: str + :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.v2024_03_02_preview.models.Level + :ivar excluded_namespaces: List of namespaces excluded from Safeguards checks. + :vartype excluded_namespaces: list[str] + """ + + _validation = { + "system_excluded_namespaces": {"readonly": True}, + "level": {"required": True}, + } + + _attribute_map = { + "system_excluded_namespaces": {"key": "systemExcludedNamespaces", "type": "[str]"}, + "version": {"key": "version", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "excluded_namespaces": {"key": "excludedNamespaces", "type": "[str]"}, + } + + def __init__( + self, + *, + level: Union[str, "_models.Level"], + version: Optional[str] = None, + excluded_namespaces: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: The version of constraints to use. + :paramtype version: str + :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.v2024_03_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.version = version + self.level = level + self.excluded_namespaces = excluded_namespaces + + +class ScaleProfile(_serialization.Model): + """Specifications on how to scale a VirtualMachines agent pool. + + :ivar manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. + :vartype manual: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManualScaleProfile] + """ + + _attribute_map = { + "manual": {"key": "manual", "type": "[ManualScaleProfile]"}, + } + + def __init__(self, *, manual: Optional[List["_models.ManualScaleProfile"]] = 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.v2024_03_02_preview.models.ManualScaleProfile] + """ + super().__init__(**kwargs) + self.manual = manual + + +class Schedule(_serialization.Model): + """One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', + '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.v2024_03_02_preview.models.DailySchedule + :ivar weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + :vartype weekly: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.RelativeMonthlySchedule + """ + + _attribute_map = { + "daily": {"key": "daily", "type": "DailySchedule"}, + "weekly": {"key": "weekly", "type": "WeeklySchedule"}, + "absolute_monthly": {"key": "absoluteMonthly", "type": "AbsoluteMonthlySchedule"}, + "relative_monthly": {"key": "relativeMonthly", "type": "RelativeMonthlySchedule"}, + } + + def __init__( + self, + *, + daily: Optional["_models.DailySchedule"] = None, + weekly: Optional["_models.WeeklySchedule"] = None, + absolute_monthly: Optional["_models.AbsoluteMonthlySchedule"] = None, + relative_monthly: Optional["_models.RelativeMonthlySchedule"] = None, + **kwargs: Any + ) -> None: + """ + :keyword daily: For schedules like: 'recur every day' or 'recur every 3 days'. + :paramtype daily: ~azure.mgmt.containerservice.v2024_03_02_preview.models.DailySchedule + :keyword weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on + Wednesday'. + :paramtype weekly: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_02_preview.models.RelativeMonthlySchedule + """ + super().__init__(**kwargs) + self.daily = daily + self.weekly = weekly + self.absolute_monthly = absolute_monthly + self.relative_monthly = relative_monthly + + +class ServiceMeshProfile(_serialization.Model): + """Service mesh profile for a managed cluster. + + 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.v2024_03_02_preview.models.ServiceMeshMode + :ivar istio: Istio service mesh configuration. + :vartype istio: ~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioServiceMesh + """ + + _validation = { + "mode": {"required": True}, + } + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + "istio": {"key": "istio", "type": "IstioServiceMesh"}, + } + + def __init__( + self, + *, + mode: Union[str, "_models.ServiceMeshMode"], + istio: Optional["_models.IstioServiceMesh"] = None, + **kwargs: Any + ) -> None: + """ + :keyword mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". + :paramtype mode: str or ~azure.mgmt.containerservice.v2024_03_02_preview.models.ServiceMeshMode + :keyword istio: Istio service mesh configuration. + :paramtype istio: ~azure.mgmt.containerservice.v2024_03_02_preview.models.IstioServiceMesh + """ + super().__init__(**kwargs) + self.mode = mode + self.istio = istio + + +class Snapshot(TrackedResource): # pylint: disable=too-many-instance-attributes + """A node pool snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_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.v2024_03_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. + :vartype enable_fips: bool + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "kubernetes_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "os_type": {"readonly": True}, + "os_sku": {"readonly": True}, + "vm_size": {"readonly": True}, + "enable_fips": {"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}"}, + "location": {"key": "location", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "snapshot_type": {"key": "properties.snapshotType", "type": "str"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "node_image_version": {"key": "properties.nodeImageVersion", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "os_sku": {"key": "properties.osSku", "type": "str"}, + "vm_size": {"key": "properties.vmSize", "type": "str"}, + "enable_fips": {"key": "properties.enableFIPS", "type": "bool"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["_models.CreationData"] = None, + snapshot_type: Union[str, "_models.SnapshotType"] = "NodePool", + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :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.v2024_03_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.v2024_03_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 + + +class SnapshotListResult(_serialization.Model): + """The response from the List Snapshots operation. + + 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.v2024_03_02_preview.models.Snapshot] + :ivar next_link: The URL to get the next set of snapshot results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Snapshot]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.Snapshot"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of snapshots. + :paramtype value: list[~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class SysctlConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Sysctl settings for Linux agent nodes. + + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int + """ + + _validation = { + "net_ipv4_tcpkeepalive_intvl": {"maximum": 90, "minimum": 10}, + "net_netfilter_nf_conntrack_max": {"maximum": 2097152, "minimum": 131072}, + "net_netfilter_nf_conntrack_buckets": {"maximum": 524288, "minimum": 65536}, + } + + _attribute_map = { + "net_core_somaxconn": {"key": "netCoreSomaxconn", "type": "int"}, + "net_core_netdev_max_backlog": {"key": "netCoreNetdevMaxBacklog", "type": "int"}, + "net_core_rmem_default": {"key": "netCoreRmemDefault", "type": "int"}, + "net_core_rmem_max": {"key": "netCoreRmemMax", "type": "int"}, + "net_core_wmem_default": {"key": "netCoreWmemDefault", "type": "int"}, + "net_core_wmem_max": {"key": "netCoreWmemMax", "type": "int"}, + "net_core_optmem_max": {"key": "netCoreOptmemMax", "type": "int"}, + "net_ipv4_tcp_max_syn_backlog": {"key": "netIpv4TcpMaxSynBacklog", "type": "int"}, + "net_ipv4_tcp_max_tw_buckets": {"key": "netIpv4TcpMaxTwBuckets", "type": "int"}, + "net_ipv4_tcp_fin_timeout": {"key": "netIpv4TcpFinTimeout", "type": "int"}, + "net_ipv4_tcp_keepalive_time": {"key": "netIpv4TcpKeepaliveTime", "type": "int"}, + "net_ipv4_tcp_keepalive_probes": {"key": "netIpv4TcpKeepaliveProbes", "type": "int"}, + "net_ipv4_tcpkeepalive_intvl": {"key": "netIpv4TcpkeepaliveIntvl", "type": "int"}, + "net_ipv4_tcp_tw_reuse": {"key": "netIpv4TcpTwReuse", "type": "bool"}, + "net_ipv4_ip_local_port_range": {"key": "netIpv4IpLocalPortRange", "type": "str"}, + "net_ipv4_neigh_default_gc_thresh1": {"key": "netIpv4NeighDefaultGcThresh1", "type": "int"}, + "net_ipv4_neigh_default_gc_thresh2": {"key": "netIpv4NeighDefaultGcThresh2", "type": "int"}, + "net_ipv4_neigh_default_gc_thresh3": {"key": "netIpv4NeighDefaultGcThresh3", "type": "int"}, + "net_netfilter_nf_conntrack_max": {"key": "netNetfilterNfConntrackMax", "type": "int"}, + "net_netfilter_nf_conntrack_buckets": {"key": "netNetfilterNfConntrackBuckets", "type": "int"}, + "fs_inotify_max_user_watches": {"key": "fsInotifyMaxUserWatches", "type": "int"}, + "fs_file_max": {"key": "fsFileMax", "type": "int"}, + "fs_aio_max_nr": {"key": "fsAioMaxNr", "type": "int"}, + "fs_nr_open": {"key": "fsNrOpen", "type": "int"}, + "kernel_threads_max": {"key": "kernelThreadsMax", "type": "int"}, + "vm_max_map_count": {"key": "vmMaxMapCount", "type": "int"}, + "vm_swappiness": {"key": "vmSwappiness", "type": "int"}, + "vm_vfs_cache_pressure": {"key": "vmVfsCachePressure", "type": "int"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + net_core_somaxconn: Optional[int] = None, + net_core_netdev_max_backlog: Optional[int] = None, + net_core_rmem_default: Optional[int] = None, + net_core_rmem_max: Optional[int] = None, + net_core_wmem_default: Optional[int] = None, + net_core_wmem_max: Optional[int] = None, + net_core_optmem_max: Optional[int] = None, + net_ipv4_tcp_max_syn_backlog: Optional[int] = None, + net_ipv4_tcp_max_tw_buckets: Optional[int] = None, + net_ipv4_tcp_fin_timeout: Optional[int] = None, + net_ipv4_tcp_keepalive_time: Optional[int] = None, + net_ipv4_tcp_keepalive_probes: Optional[int] = None, + net_ipv4_tcpkeepalive_intvl: Optional[int] = None, + net_ipv4_tcp_tw_reuse: Optional[bool] = None, + net_ipv4_ip_local_port_range: Optional[str] = None, + net_ipv4_neigh_default_gc_thresh1: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh2: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh3: Optional[int] = None, + net_netfilter_nf_conntrack_max: Optional[int] = None, + net_netfilter_nf_conntrack_buckets: Optional[int] = None, + fs_inotify_max_user_watches: Optional[int] = None, + fs_file_max: Optional[int] = None, + fs_aio_max_nr: Optional[int] = None, + fs_nr_open: Optional[int] = None, + kernel_threads_max: Optional[int] = None, + vm_max_map_count: Optional[int] = None, + vm_swappiness: Optional[int] = None, + vm_vfs_cache_pressure: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ + super().__init__(**kwargs) + self.net_core_somaxconn = net_core_somaxconn + self.net_core_netdev_max_backlog = net_core_netdev_max_backlog + self.net_core_rmem_default = net_core_rmem_default + self.net_core_rmem_max = net_core_rmem_max + self.net_core_wmem_default = net_core_wmem_default + self.net_core_wmem_max = net_core_wmem_max + self.net_core_optmem_max = net_core_optmem_max + self.net_ipv4_tcp_max_syn_backlog = net_ipv4_tcp_max_syn_backlog + self.net_ipv4_tcp_max_tw_buckets = net_ipv4_tcp_max_tw_buckets + self.net_ipv4_tcp_fin_timeout = net_ipv4_tcp_fin_timeout + self.net_ipv4_tcp_keepalive_time = net_ipv4_tcp_keepalive_time + self.net_ipv4_tcp_keepalive_probes = net_ipv4_tcp_keepalive_probes + self.net_ipv4_tcpkeepalive_intvl = net_ipv4_tcpkeepalive_intvl + self.net_ipv4_tcp_tw_reuse = net_ipv4_tcp_tw_reuse + self.net_ipv4_ip_local_port_range = net_ipv4_ip_local_port_range + self.net_ipv4_neigh_default_gc_thresh1 = net_ipv4_neigh_default_gc_thresh1 + self.net_ipv4_neigh_default_gc_thresh2 = net_ipv4_neigh_default_gc_thresh2 + self.net_ipv4_neigh_default_gc_thresh3 = net_ipv4_neigh_default_gc_thresh3 + self.net_netfilter_nf_conntrack_max = net_netfilter_nf_conntrack_max + self.net_netfilter_nf_conntrack_buckets = net_netfilter_nf_conntrack_buckets + self.fs_inotify_max_user_watches = fs_inotify_max_user_watches + self.fs_file_max = fs_file_max + self.fs_aio_max_nr = fs_aio_max_nr + self.fs_nr_open = fs_nr_open + self.kernel_threads_max = kernel_threads_max + self.vm_max_map_count = vm_max_map_count + self.vm_swappiness = vm_swappiness + self.vm_vfs_cache_pressure = vm_vfs_cache_pressure + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :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.v2024_03_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. + :vartype last_modified_by: str + :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.v2024_03_02_preview.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :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.v2024_03_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. + :paramtype last_modified_by: str + :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.v2024_03_02_preview.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TagsObject(_serialization.Model): + """Tags object for patch operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class TimeInWeek(_serialization.Model): + """Time in a week. + + :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.v2024_03_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. + :vartype hour_slots: list[int] + """ + + _attribute_map = { + "day": {"key": "day", "type": "str"}, + "hour_slots": {"key": "hourSlots", "type": "[int]"}, + } + + def __init__( + self, + *, + day: Optional[Union[str, "_models.WeekDay"]] = None, + hour_slots: Optional[List[int]] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_03_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. + :paramtype hour_slots: list[int] + """ + super().__init__(**kwargs) + self.day = day + self.hour_slots = hour_slots + + +class TimeSpan(_serialization.Model): + """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime + """ + + _attribute_map = { + "start": {"key": "start", "type": "iso-8601"}, + "end": {"key": "end", "type": "iso-8601"}, + } + + def __init__( + self, *, start: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ + super().__init__(**kwargs) + self.start = start + self.end = end + + +class TrustedAccessRole(_serialization.Model): + """Trusted access role definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar source_resource_type: Resource type of Azure resource. + :vartype source_resource_type: str + :ivar name: Name of role, name is unique under a source resource type. + :vartype name: str + :ivar rules: List of rules for the role. This maps to 'rules' property of `Kubernetes Cluster + Role + `_. + :vartype rules: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.TrustedAccessRoleRule] + """ + + _validation = { + "source_resource_type": {"readonly": True}, + "name": {"readonly": True}, + "rules": {"readonly": True}, + } + + _attribute_map = { + "source_resource_type": {"key": "sourceResourceType", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "rules": {"key": "rules", "type": "[TrustedAccessRoleRule]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.source_resource_type = None + self.name = None + self.rules = None + + +class TrustedAccessRoleBinding(Resource): + """Defines binding between a resource and role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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 + :ivar roles: A list of roles to bind, each item is a resource type qualified role name. For + example: 'Microsoft.MachineLearningServices/workspaces/reader'. Required. + :vartype roles: list[str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "source_resource_id": {"required": True}, + "roles": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "source_resource_id": {"key": "properties.sourceResourceId", "type": "str"}, + "roles": {"key": "properties.roles", "type": "[str]"}, + } + + def __init__(self, *, source_resource_id: str, roles: List[str], **kwargs: Any) -> None: + """ + :keyword source_resource_id: The ARM resource ID of source resource that trusted access is + configured for. Required. + :paramtype source_resource_id: str + :keyword roles: A list of roles to bind, each item is a resource type qualified role name. For + example: 'Microsoft.MachineLearningServices/workspaces/reader'. Required. + :paramtype roles: list[str] + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.source_resource_id = source_resource_id + self.roles = roles + + +class TrustedAccessRoleBindingListResult(_serialization.Model): + """List of trusted access role bindings. + + 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.v2024_03_02_preview.models.TrustedAccessRoleBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[TrustedAccessRoleBinding]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.TrustedAccessRoleBinding"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Role binding list. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_03_02_preview.models.TrustedAccessRoleBinding] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class TrustedAccessRoleListResult(_serialization.Model): + """List of trusted access roles. + + 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.v2024_03_02_preview.models.TrustedAccessRole] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[TrustedAccessRole]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class TrustedAccessRoleRule(_serialization.Model): + """Rule for trusted access role. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar verbs: List of allowed verbs. + :vartype verbs: list[str] + :ivar api_groups: List of allowed apiGroups. + :vartype api_groups: list[str] + :ivar resources: List of allowed resources. + :vartype resources: list[str] + :ivar resource_names: List of allowed names. + :vartype resource_names: list[str] + :ivar non_resource_ur_ls: List of allowed nonResourceURLs. + :vartype non_resource_ur_ls: list[str] + """ + + _validation = { + "verbs": {"readonly": True}, + "api_groups": {"readonly": True}, + "resources": {"readonly": True}, + "resource_names": {"readonly": True}, + "non_resource_ur_ls": {"readonly": True}, + } + + _attribute_map = { + "verbs": {"key": "verbs", "type": "[str]"}, + "api_groups": {"key": "apiGroups", "type": "[str]"}, + "resources": {"key": "resources", "type": "[str]"}, + "resource_names": {"key": "resourceNames", "type": "[str]"}, + "non_resource_ur_ls": {"key": "nonResourceURLs", "type": "[str]"}, + } + + 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 + + +class UpgradeOverrideSettings(_serialization.Model): + """Settings for overrides when upgrading a cluster. + + :ivar force_upgrade: Whether to force upgrade the cluster. Note that this option instructs + upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + Enable this option only with caution. + :vartype force_upgrade: bool + :ivar until: Until when the overrides are effective. Note that this only matches the start time + of an upgrade, and the effectiveness won't change once an upgrade starts even if the ``until`` + expires as upgrade proceeds. This field is not set by default. It must be set for the overrides + to take effect. + :vartype until: ~datetime.datetime + """ + + _attribute_map = { + "force_upgrade": {"key": "forceUpgrade", "type": "bool"}, + "until": {"key": "until", "type": "iso-8601"}, + } + + def __init__( + self, *, force_upgrade: Optional[bool] = None, until: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """ + :keyword force_upgrade: Whether to force upgrade the cluster. Note that this option instructs + upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + Enable this option only with caution. + :paramtype force_upgrade: bool + :keyword until: Until when the overrides are effective. Note that this only matches the start + time of an upgrade, and the effectiveness won't change once an upgrade starts even if the + ``until`` expires as upgrade proceeds. This field is not set by default. It must be set for the + overrides to take effect. + :paramtype until: ~datetime.datetime + """ + super().__init__(**kwargs) + self.force_upgrade = force_upgrade + self.until = until + + +class VirtualMachineNodes(_serialization.Model): + """Current status on a group of nodes of the same vm size. + + :ivar size: The VM size of the agents used to host this group of nodes. + :vartype size: str + :ivar count: Number of nodes. + :vartype count: int + """ + + _attribute_map = { + "size": {"key": "size", "type": "str"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, size: Optional[str] = None, count: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword size: The VM size of the agents used to host this group of nodes. + :paramtype size: str + :keyword count: Number of nodes. + :paramtype count: int + """ + super().__init__(**kwargs) + self.size = size + self.count = count + + +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.v2024_03_02_preview.models.ScaleProfile + """ + + _attribute_map = { + "scale": {"key": "scale", "type": "ScaleProfile"}, + } + + 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.v2024_03_02_preview.models.ScaleProfile + """ + super().__init__(**kwargs) + self.scale = scale + + +class WeeklySchedule(_serialization.Model): + """For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + + All required parameters must be populated in order to send to server. + + :ivar interval_weeks: Specifies the number of weeks between each set of occurrences. Required. + :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.v2024_03_02_preview.models.WeekDay + """ + + _validation = { + "interval_weeks": {"required": True, "maximum": 4, "minimum": 1}, + "day_of_week": {"required": True}, + } + + _attribute_map = { + "interval_weeks": {"key": "intervalWeeks", "type": "int"}, + "day_of_week": {"key": "dayOfWeek", "type": "str"}, + } + + def __init__(self, *, interval_weeks: int, day_of_week: Union[str, "_models.WeekDay"], **kwargs: Any) -> None: + """ + :keyword interval_weeks: Specifies the number of weeks between each set of occurrences. + Required. + :paramtype interval_weeks: int + :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.v2024_03_02_preview.models.WeekDay + """ + super().__init__(**kwargs) + self.interval_weeks = interval_weeks + self.day_of_week = day_of_week + + +class WindowsGmsaProfile(_serialization.Model): + """Windows gMSA Profile in the managed cluster. + + :ivar enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :vartype enabled: bool + :ivar dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it to + empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :vartype dns_server: str + :ivar root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :vartype root_domain_name: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "dns_server": {"key": "dnsServer", "type": "str"}, + "root_domain_name": {"key": "rootDomainName", "type": "str"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + dns_server: Optional[str] = None, + root_domain_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :paramtype enabled: bool + :keyword dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it + to empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :paramtype dns_server: str + :keyword root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :paramtype root_domain_name: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.dns_server = dns_server + self.root_domain_name = root_domain_name diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_03_02_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/__init__.py new file mode 100644 index 000000000000..4400927248e5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/__init__.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._machines_operations import MachinesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._operation_status_result_operations import OperationStatusResultOperations +from ._snapshots_operations import SnapshotsOperations +from ._managed_cluster_snapshots_operations import ManagedClusterSnapshotsOperations +from ._trusted_access_roles_operations import TrustedAccessRolesOperations +from ._trusted_access_role_bindings_operations import TrustedAccessRoleBindingsOperations +from ._load_balancers_operations import LoadBalancersOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "MachinesOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "OperationStatusResultOperations", + "SnapshotsOperations", + "ManagedClusterSnapshotsOperations", + "TrustedAccessRolesOperations", + "TrustedAccessRoleBindingsOperations", + "LoadBalancersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..16c392014ec0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_agent_pools_operations.py @@ -0,0 +1,1588 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_abort_latest_operation_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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) + + +def build_list_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", "2024-03-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( + "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, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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, + agent_pool_name: str, + subscription_id: str, + *, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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}/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", 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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + 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, + agent_pool_name: str, + subscription_id: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ignore_pod_disruption_budget is not None: + _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( + "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" + ) + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_upgrade_profile_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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_delete_machines_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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}/agentPools/{agentPoolName}/deleteMachines", + ) # 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", 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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_available_agent_pool_versions_request( # pylint: disable=name-too-long + 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", "2024-03-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( + "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_upgrade_node_image_version_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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 AgentPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`agent_pools` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Aborts last operation running on agent pool. + + Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + completes before cancellation can take place, an error is returned. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_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 "2024-03-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterable["_models.AgentPool"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AgentPoolListResult", 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, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPool: + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :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 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.v2024_03_02_preview.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPool", pipeline_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, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentPool] = 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, "AgentPool") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AgentPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AgentPool", pipeline_response) + + 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, + agent_pool_name: str, + parameters: _models.AgentPool, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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.v2024_03_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 + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_03_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. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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, + agent_pool_name=agent_pool_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AgentPool", pipeline_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.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + @distributed_trace + def get_upgrade_profile( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPoolUpgradeProfile: + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :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 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.v2024_03_02_preview.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_machines_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(machines, (IOBase, bytes)): + _content = machines + else: + _json = self._serialize.body(machines, "AgentPoolDeleteMachinesParameter") + + _request = build_delete_machines_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: _models.AgentPoolDeleteMachinesParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: + ~azure.mgmt.containerservice.v2024_03_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 + :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: + """ + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_03_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] + :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 "2024-03-02-preview") + ) + 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) + 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_machines_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machines=machines, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 + + @distributed_trace + def get_available_agent_pool_versions( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.AgentPoolAvailableVersions: + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :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: AgentPoolAvailableVersions or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) + + _request = build_get_available_agent_pool_versions_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _upgrade_node_image_version_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Optional[_models.AgentPool]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[Optional[_models.AgentPool]] = kwargs.pop("cls", None) + + _request = build_upgrade_node_image_version_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_upgrade_node_image_version( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_03_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 "2024-03-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._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_load_balancers_operations.py new file mode 100644 index 000000000000..e776e3f590fe --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_load_balancers_operations.py @@ -0,0 +1,635 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union, cast +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_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", "2024-03-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( + "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, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "loadBalancerName": _SERIALIZER.url( + "load_balancer_name", + load_balancer_name, + "str", + max_length=12, + min_length=1, + pattern=r"^[a-z][a-z0-9]{0,11}$", + ), + } + + _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, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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}/loadBalancers/{loadBalancerName}", + ) # 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", 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]$", + ), + "loadBalancerName": _SERIALIZER.url( + "load_balancer_name", + load_balancer_name, + "str", + max_length=12, + min_length=1, + pattern=r"^[a-z][a-z0-9]{0,11}$", + ), + } + + _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, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "loadBalancerName": _SERIALIZER.url( + "load_balancer_name", + load_balancer_name, + "str", + max_length=12, + min_length=1, + pattern=r"^[a-z][a-z0-9]{0,11}$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class LoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`load_balancers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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.LoadBalancer"]: + """Gets a list of load balancers in the specified managed cluster. + + Gets a list of load balancers 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 LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", 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, load_balancer_name: str, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + Gets the specified load balancer. + + :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 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.v2024_03_02_preview.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + name: Optional[str] = None, + primary_agent_pool_name: Optional[str] = None, + allow_service_placement: Optional[bool] = None, + service_label_selector: Optional[_models.LabelSelector] = None, + service_namespace_selector: Optional[_models.LabelSelector] = None, + node_selector: Optional[_models.LabelSelector] = None, + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + Creates or updates a load balancer 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 load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param name: Name of the public load balancer. There will be an internal load balancer created + if needed, and the name will be ``-internal``. The internal lb shares the same + configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. There must be a name of kubernetes in the list. Default value is None. + :type name: str + :param 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 + agent pool can only be the primary pool for a single load balancer. Default value is None. + :type primary_agent_pool_name: str + :param allow_service_placement: Whether to automatically place services on the load balancer. + If not supplied, the default value is true. If set to false manually, both of the external and + the internal load balancer will not be selected for services unless they explicitly target it. + Default value is None. + :type allow_service_placement: bool + :param service_label_selector: Only services that must match this selector can be placed on + this load balancer. Default value is None. + :type service_label_selector: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.LabelSelector + :param service_namespace_selector: Services created in namespaces that match the selector can + be placed on this load balancer. Default value is None. + :type service_namespace_selector: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.LabelSelector + :param node_selector: Nodes that match this selector will be possible members of this load + balancer. Default value is None. + :type node_selector: ~azure.mgmt.containerservice.v2024_03_02_preview.models.LabelSelector + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _parameters = _models.LoadBalancer( + allow_service_placement=allow_service_placement, + name_properties_name=name, + node_selector=node_selector, + primary_agent_pool_name=primary_agent_pool_name, + service_label_selector=service_label_selector, + service_namespace_selector=service_namespace_selector, + ) + _json = self._serialize.body(_parameters, "LoadBalancer") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a load balancer in the specified managed cluster. + + Deletes a load balancer 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 load_balancer_name: The name of the load balancer. Required. + :type load_balancer_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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_machines_operations.py new file mode 100644 index 000000000000..555a2b22c7cb --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_machines_operations.py @@ -0,0 +1,317 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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, + agent_pool_name: str, + machine_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", pattern=r"^[a-zA-Z0-9][-_a-zA-Z0-9]{0,39}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class MachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`machines` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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, agent_pool_name: str, **kwargs: Any + ) -> Iterable["_models.Machine"]: + """Gets a list of machines in the specified agent pool. + + Gets a list of machines in the specified agent pool. + + :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 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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MachineListResult", 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, agent_pool_name: str, machine_name: str, **kwargs: Any + ) -> _models.Machine: + """Get a specific machine in the specified agent pool. + + Get a specific machine in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_03_02_preview.models.Machine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Machine", pipeline_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/v2024_03_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..11d7f2330963 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_maintenance_configurations_operations.py @@ -0,0 +1,601 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_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", "2024-03-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( + "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, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, resource_name: str, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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}/maintenanceConfigurations/{configName}", + ) # 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", 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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _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, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`maintenance_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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.MaintenanceConfiguration"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations 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 MaintenanceConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationListResult", 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, config_name: str, **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration 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 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.v2024_03_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: _models.MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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.v2024_03_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.v2024_03_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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: 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: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: Union[_models.MaintenanceConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 config_name: The name of the maintenance configuration. Required. + :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.v2024_03_02_preview.models.MaintenanceConfiguration or IO[bytes] + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceConfiguration] = 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, "MaintenanceConfiguration") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :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 config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_managed_cluster_snapshots_operations.py new file mode 100644 index 000000000000..258346194cc7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -0,0 +1,858 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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"), + } + + _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_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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_create_or_update_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", "2024-03-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/managedclustersnapshots/{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", 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 + 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_update_tags_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", "2024-03-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/managedclustersnapshots/{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", 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 + 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_delete_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", "2024-03-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( + "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class ManagedClusterSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`managed_cluster_snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: + """Gets a list of managed cluster snapshots in the specified subscription. + + Gets a list of managed cluster snapshots in the specified subscription. + + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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 list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.ManagedClusterSnapshot"]: + """Lists managed cluster snapshots in the specified subscription and resource group. + + Lists managed cluster snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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, **kwargs: Any) -> _models.ManagedClusterSnapshot: + """Gets a managed cluster snapshot. + + Gets a managed cluster snapshot. + + :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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterSnapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot to create or update. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterSnapshot, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 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.v2024_03_02_preview.models.ManagedClusterSnapshot or IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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, "ManagedClusterSnapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 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.v2024_03_02_preview.models.TagsObject or + IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a managed cluster snapshot. + + Deletes a managed cluster snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..06b67db07ec3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_managed_clusters_operations.py @@ -0,0 +1,4687 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_os_options_request( + location: str, subscription_id: str, *, resource_type: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default", + ) # 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), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if resource_type is not None: + _params["resource-type"] = _SERIALIZER.query("resource_type", resource_type, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_kubernetes_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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), + } + + _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_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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_upgrade_profile_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", "2024-03-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( + "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_access_profile_request( + resource_group_name: str, resource_name: str, role_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "roleName": _SERIALIZER.url("role_name", role_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_admin_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_user_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_monitoring_user_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_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", "2024-03-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( + "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_create_or_update_request( + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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}", + ) # 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", 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 + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + 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_update_tags_request( + resource_group_name: str, resource_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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}", + ) # 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", 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 + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + 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_delete_request( + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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") + if ignore_pod_disruption_budget is not None: + _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( + "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" + ) + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_reset_service_principal_profile_request( # pylint: disable=name-too-long + 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", "2024-03-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_reset_aad_profile_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", "2024-03-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_abort_latest_operation_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", "2024-03-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_rotate_cluster_certificates_request( # pylint: disable=name-too-long + 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", "2024-03-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_rotate_service_account_signing_keys_request( # pylint: disable=name-too-long + 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", "2024-03-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_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", "2024-03-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_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", "2024-03-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_run_command_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", "2024-03-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}/runCommand", + ) # 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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_command_result_request( + resource_group_name: str, resource_name: str, command_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "commandId": _SERIALIZER.url("command_id", command_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_outbound_network_dependencies_endpoints_request( # pylint: disable=name-too-long + 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", "2024-03-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( + "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_guardrails_versions_request( + location: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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), + "version": _SERIALIZER.url("version", version, "str", max_length=24, min_length=1), + } + + _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_list_guardrails_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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), + } + + _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_safeguards_versions_request( + location: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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), + "version": _SERIALIZER.url("version", version, "str", max_length=24, min_length=1), + } + + _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_list_safeguards_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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), + } + + _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_list_mesh_revision_profiles_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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), + } + + _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_mesh_revision_profile_request( + location: str, mode: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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), + "mode": _SERIALIZER.url( + "mode", + mode, + "str", + max_length=24, + 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_list_mesh_upgrade_profiles_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", "2024-03-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( + "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_mesh_upgrade_profile_request( + resource_group_name: str, resource_name: str, mode: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "mode": _SERIALIZER.url( + "mode", + mode, + "str", + max_length=24, + 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_rebalance_load_balancers_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", "2024-03-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}/rebalanceLoadBalancers", + ) # 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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ManagedClustersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`managed_clusters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get_os_options( + self, location: str, resource_type: Optional[str] = None, **kwargs: Any + ) -> _models.OSOptionProfile: + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. Default + value is None. + :type resource_type: str + :return: OSOptionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.OSOptionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.OSOptionProfile] = kwargs.pop("cls", None) + + _request = build_get_os_options_request( + location=location, + subscription_id=self._config.subscription_id, + resource_type=resource_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OSOptionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: + """Gets a list of supported Kubernetes versions in the specified subscription. + + Contains extra metadata on the version, including supported patch versions, capabilities, + available upgrades, and details on preview status of the version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: KubernetesVersionListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.KubernetesVersionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) + + _request = build_list_kubernetes_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("KubernetesVersionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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 list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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_upgrade_profile( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.ManagedClusterUpgradeProfile: + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile 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 + :return: ManagedClusterUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_access_profile( + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any + ) -> _models.ManagedClusterAccessProfile: + """Gets an access profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :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 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.v2024_03_02_preview.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) + + _request = build_get_access_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_admin_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials 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 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.v2024_03_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_admin_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any + ) -> _models.CredentialResults: + """Lists the user credentials of a managed cluster. + + Lists the user credentials 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :type server_fqdn: str + :param format: Only apply to AAD clusters, specifies the format of returned kubeconfig. Format + '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" and "exec". + Default value is None. + :type format: str or ~azure.mgmt.containerservice.v2024_03_02_preview.models.Format + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + format=format, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_monitoring_user_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials 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 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.v2024_03_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_monitoring_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: + """Gets a managed cluster. + + Gets 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 + :return: ManagedCluster or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_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, + parameters: Union[_models.ManagedCluster, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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, "ManagedCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + 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, + parameters: _models.ManagedCluster, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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 + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedCluster, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Is either a ManagedCluster type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + if_match: Optional[str] = None, + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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 + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 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.v2024_03_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. + :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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a managed cluster. + + Deletes 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 ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterServicePrincipalProfile") + + _request = build_reset_service_principal_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterServicePrincipalProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_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 + :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: + """ + + @overload + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 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.v2024_03_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] + :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 "2024-03-02-preview") + ) + 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) + 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._reset_service_principal_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterAADProfile") + + _request = build_reset_aad_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterAADProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_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 + :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: + """ + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 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.v2024_03_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: + """ + _headers = case_insensitive_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 "2024-03-02-preview") + ) + 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) + 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._reset_aad_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Aborts last operation running on managed cluster. + + Aborts the currently running operation on the managed cluster. The Managed Cluster will be + moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If + the operation completes before cancellation can take place, an error is returned. + + :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 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 "2024-03-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_cluster_certificates_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_rotate_cluster_certificates( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :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 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 "2024-03-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._rotate_cluster_certificates_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_service_account_signing_keys_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Rotates the service account signing keys of a managed cluster. + + Rotates the service account signing keys 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 + :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 "2024-03-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._rotate_service_account_signing_keys_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + 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 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 "2024-03-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._stop_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a 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 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 "2024-03-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._start_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_payload, (IOBase, bytes)): + _content = request_payload + else: + _json = self._serialize.body(request_payload, "RunCommandRequest") + + _request = build_run_command_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: _models.RunCommandRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: 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 RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Is either a RunCommandRequest type or a + IO[bytes] type. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_03_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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RunCommandResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RunCommandResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RunCommandResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_command_result( + self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the 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 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.v2024_03_02_preview.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + _request = build_get_command_result_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpoint"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :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 OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_outbound_network_dependencies_endpoints_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", 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_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> _models.GuardrailsAvailableVersion: + """Gets supported Guardrails version in the specified subscription and location. + + Contains Guardrails version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: GuardrailsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.GuardrailsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_guardrails_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GuardrailsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_models.GuardrailsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either GuardrailsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_guardrails_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GuardrailsAvailableVersionsList", 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_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> _models.SafeguardsAvailableVersion: + """Gets supported Safeguards version in the specified subscription and location. + + Contains Safeguards version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: SafeguardsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.SafeguardsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_safeguards_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SafeguardsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_safeguards_versions(self, location: str, **kwargs: Any) -> Iterable["_models.SafeguardsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either SafeguardsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_safeguards_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SafeguardsAvailableVersionsList", 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 list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable["_models.MeshRevisionProfile"]: + """Lists mesh revision profiles for all meshes in the specified location. + + Contains extra metadata on each revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_revision_profiles_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MeshRevisionProfileList", 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_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: + """Gets a mesh revision profile for a specified mesh in the specified location. + + Contains extra metadata on the revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshRevisionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshRevisionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_revision_profile_request( + location=location, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshRevisionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_upgrade_profiles( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterable["_models.MeshUpgradeProfile"]: + """Lists available upgrades for all service meshes in a specific cluster. + + Lists available upgrades for all service meshes in a specific 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 MeshUpgradeProfile or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_upgrade_profiles_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MeshUpgradeProfileList", 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_mesh_upgrade_profile( + self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any + ) -> _models.MeshUpgradeProfile: + """Gets available upgrades for a service mesh in a cluster. + + Gets available upgrades for a service mesh in a 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 mode: The mode of the mesh. Required. + :type mode: str + :return: MeshUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.MeshUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _rebalance_load_balancers_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "RebalanceLoadBalancersRequestBody") + + _request = build_rebalance_load_balancers_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.RebalanceLoadBalancersRequestBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 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.v2024_03_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 + :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: + """ + + @overload + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Is either a RebalanceLoadBalancersRequestBody type or a IO[bytes] + type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_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] + :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 "2024-03-02-preview") + ) + 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) + 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._rebalance_load_balancers_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_operation_status_result_operations.py new file mode 100644 index 000000000000..18ebf5137e10 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_operation_status_result_operations.py @@ -0,0 +1,416 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-03-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( + "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, operation_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str", min_length=1), + } + + _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_by_agent_pool_request( + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + operation_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class OperationStatusResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`operation_status_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> Iterable["_models.OperationStatusResult"]: + """Gets a list of operations in the specified managedCluster. + + Gets a list of operations in the specified managedCluster. + + :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 OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusResultList", 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, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified managed cluster. + + Get the status of a specific operation 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 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.v2024_03_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_by_agent_pool( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified agent pool. + + Get the status of a specific operation in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_03_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_by_agent_pool_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_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/v2024_03_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_operations.py new file mode 100644 index 000000000000..882dec7da5d8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_operations.py @@ -0,0 +1,161 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +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", "2024-03-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.ContainerService/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: + """Gets a list of operations. + + Gets a list of operations. + + :return: An iterator like instance of either OperationValue or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_03_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..169ae457f3e6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,638 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-03-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( + "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, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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}/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", 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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _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, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> _models.PrivateEndpointConnectionListResult: + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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 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.v2024_03_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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.v2024_03_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.v2024_03_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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: 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: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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. Is either a + PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = 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, "PrivateEndpointConnection") + + _request = build_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..6fb9d1a7df19 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,163 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-03-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( + "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) + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`private_link_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> _models.PrivateLinkResourcesListResult: + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_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/v2024_03_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..b8ccd054a133 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,244 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_post_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", "2024-03-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ResolvePrivateLinkServiceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`resolve_private_link_service_id` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.PrivateLinkResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. 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: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.PrivateLinkResource, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 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.v2024_03_02_preview.models.PrivateLinkResource + or IO[bytes] + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkResource] = 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, "PrivateLinkResource") + + _request = build_post_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResource", pipeline_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/v2024_03_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_snapshots_operations.py new file mode 100644 index 000000000000..bee389a5a544 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_snapshots_operations.py @@ -0,0 +1,848 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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_create_or_update_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", "2024-03-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/snapshots/{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", 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 + 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_update_tags_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", "2024-03-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/snapshots/{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", 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 + 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_delete_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", "2024-03-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( + "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class SnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: + """Gets a list of snapshots in the specified subscription. + + 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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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 list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Snapshot"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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, **kwargs: Any) -> _models.Snapshot: + """Gets a snapshot. + + Gets a snapshot. + + :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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.Snapshot, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot or IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Snapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_03_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.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 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.v2024_03_02_preview.models.TagsObject or + IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_03_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_trusted_access_role_bindings_operations.py new file mode 100644 index 000000000000..504206ac1dce --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -0,0 +1,750 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-03-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( + "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, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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_create_or_update_request( + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", + ) # 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", 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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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 + 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, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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( + "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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class TrustedAccessRoleBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`trusted_access_role_bindings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> Iterable["_models.TrustedAccessRoleBinding"]: + """List trusted access role bindings. + + List trusted access role bindings. + + :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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBindingListResult", 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, trusted_access_role_binding_name: str, **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + """Get a trusted access role binding. + + Get a trusted access role binding. + + :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 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.v2024_03_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(trusted_access_role_binding, (IOBase, bytes)): + _content = trusted_access_role_binding + else: + _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + 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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: _models.TrustedAccessRoleBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :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.v2024_03_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.v2024_03_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :param trusted_access_role_binding: A trusted access role binding. Required. + :type trusted_access_role_binding: 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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_03_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :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.v2024_03_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.v2024_03_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 "2024-03-02-preview") + ) + 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) + 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, + trusted_access_role_binding_name=trusted_access_role_binding_name, + trusted_access_role_binding=trusted_access_role_binding, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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.TrustedAccessRoleBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TrustedAccessRoleBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-03-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a trusted access role binding. + + Delete a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_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 "2024-03-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_trusted_access_roles_operations.py new file mode 100644 index 000000000000..44534a55f4bc --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/operations/_trusted_access_roles_operations.py @@ -0,0 +1,174 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-03-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), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class TrustedAccessRolesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_03_02_preview.ContainerServiceClient`'s + :attr:`trusted_access_roles` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessRole"]: + """List supported trusted access roles. + + List supported trusted access roles. + + :param location: The name of the Azure region. Required. + :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.v2024_03_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 "2024-03-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleListResult", 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_03_02_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/__init__.py new file mode 100644 index 000000000000..4f004a298ed4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/__init__.py @@ -0,0 +1,26 @@ +# 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 ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_configuration.py new file mode 100644 index 000000000000..b11fc0e6e077 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ContainerServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + :keyword api_version: Api Version. Default value is "2024-04-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", "2024-04-02-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_container_service_client.py new file mode 100644 index 000000000000..3bdbd9942e74 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_container_service_client.py @@ -0,0 +1,206 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy + +from . import models as _models +from .._serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientConfiguration +from .operations import ( + AgentPoolsOperations, + LoadBalancersOperations, + MachinesOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + OperationStatusResultOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + ResolvePrivateLinkServiceIdOperations, + SnapshotsOperations, + TrustedAccessRoleBindingsOperations, + TrustedAccessRolesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2024_04_02_preview.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2024_04_02_preview.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2024_04_02_preview.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2024_04_02_preview.operations.AgentPoolsOperations + :ivar machines: MachinesOperations operations + :vartype machines: + azure.mgmt.containerservice.v2024_04_02_preview.operations.MachinesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2024_04_02_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2024_04_02_preview.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2024_04_02_preview.operations.ResolvePrivateLinkServiceIdOperations + :ivar operation_status_result: OperationStatusResultOperations operations + :vartype operation_status_result: + azure.mgmt.containerservice.v2024_04_02_preview.operations.OperationStatusResultOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2024_04_02_preview.operations.SnapshotsOperations + :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations + :vartype managed_cluster_snapshots: + azure.mgmt.containerservice.v2024_04_02_preview.operations.ManagedClusterSnapshotsOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.v2024_04_02_preview.operations.TrustedAccessRolesOperations + :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations + :vartype trusted_access_role_bindings: + azure.mgmt.containerservice.v2024_04_02_preview.operations.TrustedAccessRoleBindingsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: + azure.mgmt.containerservice.v2024_04_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". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-04-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 + Retry-After header is present. + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + ARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + 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) + + 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, "2024-04-02-preview" + ) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.machines = MachinesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.operation_status_result = OperationStatusResultOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.load_balancers = LoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + + def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> "ContainerServiceClient": + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_metadata.json new file mode 100644 index 000000000000..09e4d48b7556 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_metadata.json @@ -0,0 +1,123 @@ +{ + "chosen_version": "2024-04-02-preview", + "total_api_version_list": ["2024-04-02-preview"], + "client": { + "name": "ContainerServiceClient", + "filename": "_container_service_client", + "description": "The Container Service Client.", + "host_value": "\"https://management.azure.com\"", + "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\"]}}, \"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\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential: \"TokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true, + "method_location": "positional" + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. The value must be an UUID. Required.", + "docstring_type": "str", + "required": true, + "method_location": "positional" + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure. Required.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. The value must be an UUID. Required.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version: Optional[str]=None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles=KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false, + "method_location": "positional" + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false, + "method_location": "positional" + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)", + "sync_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"sdkcore\": {\"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"sdkcore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "maintenance_configurations": "MaintenanceConfigurationsOperations", + "agent_pools": "AgentPoolsOperations", + "machines": "MachinesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations", + "operation_status_result": "OperationStatusResultOperations", + "snapshots": "SnapshotsOperations", + "managed_cluster_snapshots": "ManagedClusterSnapshotsOperations", + "trusted_access_roles": "TrustedAccessRolesOperations", + "trusted_access_role_bindings": "TrustedAccessRoleBindingsOperations", + "load_balancers": "LoadBalancersOperations" + } +} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_04_02_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_vendor.py new file mode 100644 index 000000000000..0dafe0e287ff --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_vendor.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_version.py new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/__init__.py new file mode 100644 index 000000000000..d14e96ddb36e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/__init__.py @@ -0,0 +1,23 @@ +# 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 ._container_service_client import ContainerServiceClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ContainerServiceClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_configuration.py new file mode 100644 index 000000000000..4ad5063ed80b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_configuration.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ContainerServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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 + :keyword api_version: Api Version. Default value is "2024-04-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", "2024-04-02-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_container_service_client.py new file mode 100644 index 000000000000..e55bd01dcdfa --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_container_service_client.py @@ -0,0 +1,208 @@ +# 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 copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy + +from .. import models as _models +from ..._serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientConfiguration +from .operations import ( + AgentPoolsOperations, + LoadBalancersOperations, + MachinesOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + OperationStatusResultOperations, + Operations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + ResolvePrivateLinkServiceIdOperations, + SnapshotsOperations, + TrustedAccessRoleBindingsOperations, + TrustedAccessRolesOperations, +) + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes + """The Container Service Client. + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.AgentPoolsOperations + :ivar machines: MachinesOperations operations + :vartype machines: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.MachinesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.ResolvePrivateLinkServiceIdOperations + :ivar operation_status_result: OperationStatusResultOperations operations + :vartype operation_status_result: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.OperationStatusResultOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.SnapshotsOperations + :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations + :vartype managed_cluster_snapshots: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.ManagedClusterSnapshotsOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.TrustedAccessRolesOperations + :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations + :vartype trusted_access_role_bindings: + azure.mgmt.containerservice.v2024_04_02_preview.aio.operations.TrustedAccessRoleBindingsOperations + :ivar load_balancers: LoadBalancersOperations operations + :vartype load_balancers: + azure.mgmt.containerservice.v2024_04_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". + :type base_url: str + :keyword api_version: Api Version. Default value is "2024-04-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 + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = ContainerServiceClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + AsyncARMAutoResourceProviderRegistrationPolicy(), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + 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) + + 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, "2024-04-02-preview" + ) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.agent_pools = AgentPoolsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.machines = MachinesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.operation_status_result = OperationStatusResultOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + self.load_balancers = LoadBalancersOperations( + self._client, self._config, self._serialize, self._deserialize, "2024-04-02-preview" + ) + + def _send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ContainerServiceClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_04_02_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..4400927248e5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/__init__.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._machines_operations import MachinesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._operation_status_result_operations import OperationStatusResultOperations +from ._snapshots_operations import SnapshotsOperations +from ._managed_cluster_snapshots_operations import ManagedClusterSnapshotsOperations +from ._trusted_access_roles_operations import TrustedAccessRolesOperations +from ._trusted_access_role_bindings_operations import TrustedAccessRoleBindingsOperations +from ._load_balancers_operations import LoadBalancersOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "MachinesOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "OperationStatusResultOperations", + "SnapshotsOperations", + "ManagedClusterSnapshotsOperations", + "TrustedAccessRolesOperations", + "TrustedAccessRoleBindingsOperations", + "LoadBalancersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..e9da504ac491 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_agent_pools_operations.py @@ -0,0 +1,1189 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._agent_pools_operations import ( + build_abort_latest_operation_request, + build_create_or_update_request, + build_delete_machines_request, + build_delete_request, + build_get_available_agent_pool_versions_request, + build_get_request, + build_get_upgrade_profile_request, + build_list_request, + build_upgrade_node_image_version_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class AgentPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`agent_pools` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Aborts last operation running on agent pool. + + Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + completes before cancellation can take place, an error is returned. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_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 "2024-04-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterable["_models.AgentPool"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AgentPoolListResult", 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, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPool: + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :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 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.v2024_04_02_preview.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPool", pipeline_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, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentPool] = 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, "AgentPool") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AgentPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AgentPool", pipeline_response) + + 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, + agent_pool_name: str, + parameters: _models.AgentPool, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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.v2024_04_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 + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_04_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. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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, + agent_pool_name=agent_pool_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AgentPool", pipeline_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.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + @distributed_trace_async + async def get_upgrade_profile( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPoolUpgradeProfile: + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :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 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.v2024_04_02_preview.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_machines_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(machines, (IOBase, bytes)): + _content = machines + else: + _json = self._serialize.body(machines, "AgentPoolDeleteMachinesParameter") + + _request = build_delete_machines_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: _models.AgentPoolDeleteMachinesParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: + ~azure.mgmt.containerservice.v2024_04_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 + :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: + """ + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_04_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] + :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 "2024-04-02-preview") + ) + 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) + 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_machines_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machines=machines, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 + + @distributed_trace_async + async def get_available_agent_pool_versions( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.AgentPoolAvailableVersions: + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :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: AgentPoolAvailableVersions or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) + + _request = build_get_available_agent_pool_versions_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _upgrade_node_image_version_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Optional[_models.AgentPool]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[Optional[_models.AgentPool]] = kwargs.pop("cls", None) + + _request = build_upgrade_node_image_version_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_upgrade_node_image_version( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_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 "2024-04-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._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_load_balancers_operations.py new file mode 100644 index 000000000000..76e768ed89d3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_load_balancers_operations.py @@ -0,0 +1,451 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union, cast +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._load_balancers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_managed_cluster_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class LoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`load_balancers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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.LoadBalancer"]: + """Gets a list of load balancers in the specified managed cluster. + + Gets a list of load balancers 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 LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", 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, load_balancer_name: str, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + Gets the specified load balancer. + + :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 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.v2024_04_02_preview.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + name: Optional[str] = None, + primary_agent_pool_name: Optional[str] = None, + allow_service_placement: Optional[bool] = None, + service_label_selector: Optional[_models.LabelSelector] = None, + service_namespace_selector: Optional[_models.LabelSelector] = None, + node_selector: Optional[_models.LabelSelector] = None, + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + Creates or updates a load balancer 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 load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param name: Name of the public load balancer. There will be an internal load balancer created + if needed, and the name will be ``-internal``. The internal lb shares the same + configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. There must be a name of kubernetes in the list. Default value is None. + :type name: str + :param 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 + agent pool can only be the primary pool for a single load balancer. Default value is None. + :type primary_agent_pool_name: str + :param allow_service_placement: Whether to automatically place services on the load balancer. + If not supplied, the default value is true. If set to false manually, both of the external and + the internal load balancer will not be selected for services unless they explicitly target it. + Default value is None. + :type allow_service_placement: bool + :param service_label_selector: Only services that must match this selector can be placed on + this load balancer. Default value is None. + :type service_label_selector: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.LabelSelector + :param service_namespace_selector: Services created in namespaces that match the selector can + be placed on this load balancer. Default value is None. + :type service_namespace_selector: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.LabelSelector + :param node_selector: Nodes that match this selector will be possible members of this load + balancer. Default value is None. + :type node_selector: ~azure.mgmt.containerservice.v2024_04_02_preview.models.LabelSelector + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _parameters = _models.LoadBalancer( + allow_service_placement=allow_service_placement, + name_properties_name=name, + node_selector=node_selector, + primary_agent_pool_name=primary_agent_pool_name, + service_label_selector=service_label_selector, + service_namespace_selector=service_namespace_selector, + ) + _json = self._serialize.body(_parameters, "LoadBalancer") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a load balancer in the specified managed cluster. + + Deletes a load balancer 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 load_balancer_name: The name of the load balancer. Required. + :type load_balancer_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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_machines_operations.py new file mode 100644 index 000000000000..c4f5b61d213f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_machines_operations.py @@ -0,0 +1,221 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._machines_operations import build_get_request, build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`machines` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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, agent_pool_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Machine"]: + """Gets a list of machines in the specified agent pool. + + Gets a list of machines in the specified agent pool. + + :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 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.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MachineListResult", 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, agent_pool_name: str, machine_name: str, **kwargs: Any + ) -> _models.Machine: + """Get a specific machine in the specified agent pool. + + Get a specific machine in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_04_02_preview.models.Machine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Machine", pipeline_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/v2024_04_02_preview/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..213ff2fc0db6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -0,0 +1,438 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._maintenance_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_managed_cluster_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`maintenance_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations 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 MaintenanceConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationListResult", 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, config_name: str, **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration 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 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.v2024_04_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: _models.MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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.v2024_04_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.v2024_04_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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: 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: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: Union[_models.MaintenanceConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 config_name: The name of the maintenance configuration. Required. + :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.v2024_04_02_preview.models.MaintenanceConfiguration or IO[bytes] + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceConfiguration] = 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, "MaintenanceConfiguration") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :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 config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py new file mode 100644 index 000000000000..c2bd07832600 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -0,0 +1,643 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._managed_cluster_snapshots_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ManagedClusterSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`managed_cluster_snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of managed cluster snapshots in the specified subscription. + + Gets a list of managed cluster snapshots in the specified subscription. + + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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 + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ManagedClusterSnapshot"]: + """Lists managed cluster snapshots in the specified subscription and resource group. + + Lists managed cluster snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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, **kwargs: Any) -> _models.ManagedClusterSnapshot: + """Gets a managed cluster snapshot. + + Gets a managed cluster snapshot. + + :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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterSnapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot to create or update. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterSnapshot, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 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.v2024_04_02_preview.models.ManagedClusterSnapshot or IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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, "ManagedClusterSnapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 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.v2024_04_02_preview.models.TagsObject or + IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a managed cluster snapshot. + + Deletes a managed cluster snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..0b6cbf2a73c6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,3472 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._managed_clusters_operations import ( + build_abort_latest_operation_request, + build_create_or_update_request, + build_delete_request, + build_get_access_profile_request, + build_get_command_result_request, + build_get_guardrails_versions_request, + build_get_mesh_revision_profile_request, + build_get_mesh_upgrade_profile_request, + build_get_os_options_request, + build_get_request, + build_get_safeguards_versions_request, + build_get_upgrade_profile_request, + build_list_by_resource_group_request, + build_list_cluster_admin_credentials_request, + build_list_cluster_monitoring_user_credentials_request, + build_list_cluster_user_credentials_request, + build_list_guardrails_versions_request, + build_list_kubernetes_versions_request, + build_list_mesh_revision_profiles_request, + build_list_mesh_upgrade_profiles_request, + build_list_outbound_network_dependencies_endpoints_request, + build_list_request, + build_list_safeguards_versions_request, + build_rebalance_load_balancers_request, + build_reset_aad_profile_request, + build_reset_service_principal_profile_request, + build_rotate_cluster_certificates_request, + build_rotate_service_account_signing_keys_request, + build_run_command_request, + build_start_request, + build_stop_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ManagedClustersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`managed_clusters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def get_os_options( + self, location: str, resource_type: Optional[str] = None, **kwargs: Any + ) -> _models.OSOptionProfile: + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. Default + value is None. + :type resource_type: str + :return: OSOptionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.OSOptionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.OSOptionProfile] = kwargs.pop("cls", None) + + _request = build_get_os_options_request( + location=location, + subscription_id=self._config.subscription_id, + resource_type=resource_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OSOptionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: + """Gets a list of supported Kubernetes versions in the specified subscription. + + Contains extra metadata on the version, including supported patch versions, capabilities, + available upgrades, and details on preview status of the version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: KubernetesVersionListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.KubernetesVersionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) + + _request = build_list_kubernetes_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("KubernetesVersionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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 + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ManagedCluster"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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_upgrade_profile( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.ManagedClusterUpgradeProfile: + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile 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 + :return: ManagedClusterUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_access_profile( + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any + ) -> _models.ManagedClusterAccessProfile: + """Gets an access profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :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 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.v2024_04_02_preview.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) + + _request = build_get_access_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_admin_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials 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 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.v2024_04_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_admin_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any + ) -> _models.CredentialResults: + """Lists the user credentials of a managed cluster. + + Lists the user credentials 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :type server_fqdn: str + :param format: Only apply to AAD clusters, specifies the format of returned kubeconfig. Format + '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" and "exec". + Default value is None. + :type format: str or ~azure.mgmt.containerservice.v2024_04_02_preview.models.Format + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + format=format, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_monitoring_user_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials 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 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.v2024_04_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_monitoring_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: + """Gets a managed cluster. + + Gets 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 + :return: ManagedCluster or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_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, + parameters: Union[_models.ManagedCluster, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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, "ManagedCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + 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, + parameters: _models.ManagedCluster, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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 + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedCluster, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Is either a ManagedCluster type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + if_match: Optional[str] = None, + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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 + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 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.v2024_04_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. + :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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed cluster. + + Deletes 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 ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + async def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterServicePrincipalProfile") + + _request = build_reset_service_principal_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterServicePrincipalProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_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 + :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: + """ + + @overload + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 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.v2024_04_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] + :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 "2024-04-02-preview") + ) + 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) + 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._reset_service_principal_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterAADProfile") + + _request = build_reset_aad_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterAADProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_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 + :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: + """ + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 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.v2024_04_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: + """ + _headers = case_insensitive_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 "2024-04-02-preview") + ) + 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) + 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._reset_aad_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Aborts last operation running on managed cluster. + + Aborts the currently running operation on the managed cluster. The Managed Cluster will be + moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If + the operation completes before cancellation can take place, an error is returned. + + :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 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 "2024-04-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_cluster_certificates_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_rotate_cluster_certificates( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :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 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 "2024-04-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._rotate_cluster_certificates_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_service_account_signing_keys_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the service account signing keys of a managed cluster. + + Rotates the service account signing keys 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 + :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 "2024-04-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._rotate_service_account_signing_keys_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + 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 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 "2024-04-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._stop_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a 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 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 "2024-04-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._start_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_payload, (IOBase, bytes)): + _content = request_payload + else: + _json = self._serialize.body(request_payload, "RunCommandRequest") + + _request = build_run_command_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: _models.RunCommandRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: 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 RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Is either a RunCommandRequest type or a + IO[bytes] type. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RunCommandResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RunCommandResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RunCommandResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_command_result( + self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the 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 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.v2024_04_02_preview.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + _request = build_get_command_result_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterable["_models.OutboundEnvironmentEndpoint"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :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 OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_outbound_network_dependencies_endpoints_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", 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_guardrails_versions( + self, location: str, version: str, **kwargs: Any + ) -> _models.GuardrailsAvailableVersion: + """Gets supported Guardrails version in the specified subscription and location. + + Contains Guardrails version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: GuardrailsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.GuardrailsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_guardrails_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GuardrailsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_guardrails_versions( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.GuardrailsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either GuardrailsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_guardrails_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GuardrailsAvailableVersionsList", 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_safeguards_versions( + self, location: str, version: str, **kwargs: Any + ) -> _models.SafeguardsAvailableVersion: + """Gets supported Safeguards version in the specified subscription and location. + + Contains Safeguards version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: SafeguardsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SafeguardsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_safeguards_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SafeguardsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_safeguards_versions( + self, location: str, **kwargs: Any + ) -> AsyncIterable["_models.SafeguardsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either SafeguardsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_safeguards_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SafeguardsAvailableVersionsList", 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 + def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> AsyncIterable["_models.MeshRevisionProfile"]: + """Lists mesh revision profiles for all meshes in the specified location. + + Contains extra metadata on each revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_revision_profiles_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MeshRevisionProfileList", 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_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: + """Gets a mesh revision profile for a specified mesh in the specified location. + + Contains extra metadata on the revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshRevisionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshRevisionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_revision_profile_request( + location=location, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshRevisionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_upgrade_profiles( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterable["_models.MeshUpgradeProfile"]: + """Lists available upgrades for all service meshes in a specific cluster. + + Lists available upgrades for all service meshes in a specific 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 MeshUpgradeProfile or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_upgrade_profiles_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("MeshUpgradeProfileList", 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_mesh_upgrade_profile( + self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any + ) -> _models.MeshUpgradeProfile: + """Gets available upgrades for a service mesh in a cluster. + + Gets available upgrades for a service mesh in a 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 mode: The mode of the mesh. Required. + :type mode: str + :return: MeshUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _rebalance_load_balancers_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "RebalanceLoadBalancersRequestBody") + + _request = build_rebalance_load_balancers_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.RebalanceLoadBalancersRequestBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 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.v2024_04_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 + :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: + """ + + @overload + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Is either a RebalanceLoadBalancersRequestBody type or a IO[bytes] + type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_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] + :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 "2024-04-02-preview") + ) + 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) + 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._rebalance_load_balancers_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_operation_status_result_operations.py new file mode 100644 index 000000000000..22e1db13592e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_operation_status_result_operations.py @@ -0,0 +1,288 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operation_status_result_operations import ( + build_get_by_agent_pool_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class OperationStatusResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`operation_status_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """Gets a list of operations in the specified managedCluster. + + Gets a list of operations in the specified managedCluster. + + :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 OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusResultList", 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, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified managed cluster. + + Get the status of a specific operation 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 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.v2024_04_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_by_agent_pool( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified agent pool. + + Get the status of a specific operation in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_04_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_by_agent_pool_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_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/v2024_04_02_preview/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_operations.py new file mode 100644 index 000000000000..47ff0514da1d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_operations.py @@ -0,0 +1,139 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: + """Gets a list of operations. + + Gets a list of operations. + + :return: An iterator like instance of either OperationValue or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_04_02_preview/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..3a5ac5339c1a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,456 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_endpoint_connections_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnectionListResult: + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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 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.v2024_04_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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.v2024_04_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.v2024_04_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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: 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: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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. Is either a + PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = 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, "PrivateEndpointConnection") + + _request = build_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..6ccbee172cd4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,120 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._private_link_resources_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`private_link_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace_async + async def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateLinkResourcesListResult: + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_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/v2024_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..fc265ce16b59 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,198 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._resolve_private_link_service_id_operations import build_post_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ResolvePrivateLinkServiceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`resolve_private_link_service_id` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.PrivateLinkResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. 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: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.PrivateLinkResource, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 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.v2024_04_02_preview.models.PrivateLinkResource + or IO[bytes] + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkResource] = 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, "PrivateLinkResource") + + _request = build_post_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResource", pipeline_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/v2024_04_02_preview/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..f36c6a5ecdc4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_snapshots_operations.py @@ -0,0 +1,635 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._snapshots_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_request, + build_update_tags_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: + """Gets a list of snapshots in the specified subscription. + + 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.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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 + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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, **kwargs: Any) -> _models.Snapshot: + """Gets a snapshot. + + Gets a snapshot. + + :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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.Snapshot, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot or IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Snapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 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.v2024_04_02_preview.models.TagsObject or + IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py new file mode 100644 index 000000000000..fab828d12bf3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -0,0 +1,554 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._trusted_access_role_bindings_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class TrustedAccessRoleBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`trusted_access_role_bindings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """List trusted access role bindings. + + List trusted access role bindings. + + :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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBindingListResult", 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, trusted_access_role_binding_name: str, **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + """Get a trusted access role binding. + + Get a trusted access role binding. + + :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 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.v2024_04_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(trusted_access_role_binding, (IOBase, bytes)): + _content = trusted_access_role_binding + else: + _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + 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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: _models.TrustedAccessRoleBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :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.v2024_04_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.v2024_04_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :param trusted_access_role_binding: A trusted access role binding. Required. + :type trusted_access_role_binding: 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 TrustedAccessRoleBinding or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :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.v2024_04_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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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, + trusted_access_role_binding_name=trusted_access_role_binding_name, + trusted_access_role_binding=trusted_access_role_binding, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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.TrustedAccessRoleBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TrustedAccessRoleBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a trusted access role binding. + + Delete a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_trusted_access_roles_operations.py new file mode 100644 index 000000000000..521956c41c01 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -0,0 +1,143 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._trusted_access_roles_operations import build_list_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class TrustedAccessRolesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.aio.ContainerServiceClient`'s + :attr:`trusted_access_roles` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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"]: + """List supported trusted access roles. + + List supported trusted access roles. + + :param location: The name of the Azure region. Required. + :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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleListResult", 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/__init__.py new file mode 100644 index 000000000000..b80c69a4c30a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/__init__.py @@ -0,0 +1,531 @@ +# 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 ._models_py3 import AbsoluteMonthlySchedule +from ._models_py3 import AdvancedNetworking +from ._models_py3 import AdvancedNetworkingObservability +from ._models_py3 import AgentPool +from ._models_py3 import AgentPoolArtifactStreamingProfile +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolDeleteMachinesParameter +from ._models_py3 import AgentPoolGPUProfile +from ._models_py3 import AgentPoolGatewayProfile +from ._models_py3 import AgentPoolListResult +from ._models_py3 import AgentPoolNetworkProfile +from ._models_py3 import AgentPoolSecurityProfile +from ._models_py3 import AgentPoolUpgradeProfile +from ._models_py3 import AgentPoolUpgradeProfilePropertiesUpgradesItem +from ._models_py3 import AgentPoolUpgradeSettings +from ._models_py3 import AgentPoolWindowsProfile +from ._models_py3 import AutoScaleProfile +from ._models_py3 import AzureKeyVaultKms +from ._models_py3 import CloudErrorBody +from ._models_py3 import ClusterUpgradeSettings +from ._models_py3 import CompatibleVersions +from ._models_py3 import Component +from ._models_py3 import ComponentsByReleases +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceNetworkProfile +from ._models_py3 import ContainerServiceNetworkProfileKubeProxyConfig +from ._models_py3 import ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig +from ._models_py3 import ContainerServiceSshConfiguration +from ._models_py3 import ContainerServiceSshPublicKey +from ._models_py3 import CreationData +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import DailySchedule +from ._models_py3 import DateSpan +from ._models_py3 import DelegatedResource +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import ExtendedLocation +from ._models_py3 import GuardrailsAvailableVersion +from ._models_py3 import GuardrailsAvailableVersionsList +from ._models_py3 import GuardrailsAvailableVersionsProperties +from ._models_py3 import IPTag +from ._models_py3 import IstioCertificateAuthority +from ._models_py3 import IstioComponents +from ._models_py3 import IstioEgressGateway +from ._models_py3 import IstioIngressGateway +from ._models_py3 import IstioPluginCertificateAuthority +from ._models_py3 import IstioServiceMesh +from ._models_py3 import KubeletConfig +from ._models_py3 import KubernetesPatchVersion +from ._models_py3 import KubernetesVersion +from ._models_py3 import KubernetesVersionCapabilities +from ._models_py3 import KubernetesVersionListResult +from ._models_py3 import LabelSelector +from ._models_py3 import LabelSelectorRequirement +from ._models_py3 import LinuxOSConfig +from ._models_py3 import LoadBalancer +from ._models_py3 import LoadBalancerListResult +from ._models_py3 import Machine +from ._models_py3 import MachineIpAddress +from ._models_py3 import MachineListResult +from ._models_py3 import MachineNetworkProperties +from ._models_py3 import MachineProperties +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import MaintenanceWindow +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +from ._models_py3 import ManagedClusterAIToolchainOperatorProfile +from ._models_py3 import ManagedClusterAPIServerAccessProfile +from ._models_py3 import ManagedClusterAccessProfile +from ._models_py3 import ManagedClusterAddonProfile +from ._models_py3 import ManagedClusterAddonProfileIdentity +from ._models_py3 import ManagedClusterAgentPoolProfile +from ._models_py3 import ManagedClusterAgentPoolProfileProperties +from ._models_py3 import ManagedClusterAutoUpgradeProfile +from ._models_py3 import ManagedClusterAzureMonitorProfile +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoring +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs +from ._models_py3 import ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics +from ._models_py3 import ManagedClusterAzureMonitorProfileContainerInsights +from ._models_py3 import ManagedClusterAzureMonitorProfileKubeStateMetrics +from ._models_py3 import ManagedClusterAzureMonitorProfileMetrics +from ._models_py3 import ManagedClusterBootstrapProfile +from ._models_py3 import ManagedClusterCostAnalysis +from ._models_py3 import ManagedClusterHTTPProxyConfig +from ._models_py3 import ManagedClusterIdentity +from ._models_py3 import ManagedClusterIngressProfile +from ._models_py3 import ManagedClusterIngressProfileWebAppRouting +from ._models_py3 import ManagedClusterListResult +from ._models_py3 import ManagedClusterLoadBalancerProfile +from ._models_py3 import ManagedClusterLoadBalancerProfileManagedOutboundIPs +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPPrefixes +from ._models_py3 import ManagedClusterLoadBalancerProfileOutboundIPs +from ._models_py3 import ManagedClusterManagedOutboundIPProfile +from ._models_py3 import ManagedClusterMetricsProfile +from ._models_py3 import ManagedClusterNATGatewayProfile +from ._models_py3 import ManagedClusterNodeProvisioningProfile +from ._models_py3 import ManagedClusterNodeResourceGroupProfile +from ._models_py3 import ManagedClusterOIDCIssuerProfile +from ._models_py3 import ManagedClusterPodIdentity +from ._models_py3 import ManagedClusterPodIdentityException +from ._models_py3 import ManagedClusterPodIdentityProfile +from ._models_py3 import ManagedClusterPodIdentityProvisioningError +from ._models_py3 import ManagedClusterPodIdentityProvisioningErrorBody +from ._models_py3 import ManagedClusterPodIdentityProvisioningInfo +from ._models_py3 import ManagedClusterPoolUpgradeProfile +from ._models_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem +from ._models_py3 import ManagedClusterPropertiesAutoScalerProfile +from ._models_py3 import ManagedClusterPropertiesForSnapshot +from ._models_py3 import ManagedClusterSKU +from ._models_py3 import ManagedClusterSecurityProfile +from ._models_py3 import ManagedClusterSecurityProfileDefender +from ._models_py3 import ManagedClusterSecurityProfileDefenderSecurityMonitoring +from ._models_py3 import ManagedClusterSecurityProfileImageCleaner +from ._models_py3 import ManagedClusterSecurityProfileImageIntegrity +from ._models_py3 import ManagedClusterSecurityProfileNodeRestriction +from ._models_py3 import ManagedClusterSecurityProfileWorkloadIdentity +from ._models_py3 import ManagedClusterServicePrincipalProfile +from ._models_py3 import ManagedClusterSnapshot +from ._models_py3 import ManagedClusterSnapshotListResult +from ._models_py3 import ManagedClusterStaticEgressGatewayProfile +from ._models_py3 import ManagedClusterStorageProfile +from ._models_py3 import ManagedClusterStorageProfileBlobCSIDriver +from ._models_py3 import ManagedClusterStorageProfileDiskCSIDriver +from ._models_py3 import ManagedClusterStorageProfileFileCSIDriver +from ._models_py3 import ManagedClusterStorageProfileSnapshotController +from ._models_py3 import ManagedClusterUpgradeProfile +from ._models_py3 import ManagedClusterWindowsProfile +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfile +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfileKeda +from ._models_py3 import ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler +from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue +from ._models_py3 import ManualScaleProfile +from ._models_py3 import MeshRevision +from ._models_py3 import MeshRevisionProfile +from ._models_py3 import MeshRevisionProfileList +from ._models_py3 import MeshRevisionProfileProperties +from ._models_py3 import MeshUpgradeProfile +from ._models_py3 import MeshUpgradeProfileList +from ._models_py3 import MeshUpgradeProfileProperties +from ._models_py3 import NetworkMonitoring +from ._models_py3 import NetworkProfileForSnapshot +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationStatusResult +from ._models_py3 import OperationStatusResultList +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +from ._models_py3 import PortRange +from ._models_py3 import PowerState +from ._models_py3 import PrivateEndpoint +from ._models_py3 import PrivateEndpointConnection +from ._models_py3 import PrivateEndpointConnectionListResult +from ._models_py3 import PrivateLinkResource +from ._models_py3 import PrivateLinkResourcesListResult +from ._models_py3 import PrivateLinkServiceConnectionState +from ._models_py3 import ProxyResource +from ._models_py3 import RebalanceLoadBalancersRequestBody +from ._models_py3 import RelativeMonthlySchedule +from ._models_py3 import Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +from ._models_py3 import SafeguardsAvailableVersion +from ._models_py3 import SafeguardsAvailableVersionsList +from ._models_py3 import SafeguardsAvailableVersionsProperties +from ._models_py3 import SafeguardsProfile +from ._models_py3 import ScaleProfile +from ._models_py3 import Schedule +from ._models_py3 import ServiceMeshProfile +from ._models_py3 import Snapshot +from ._models_py3 import SnapshotListResult +from ._models_py3 import SubResource +from ._models_py3 import SysctlConfig +from ._models_py3 import SystemData +from ._models_py3 import TagsObject +from ._models_py3 import TimeInWeek +from ._models_py3 import TimeSpan +from ._models_py3 import TrackedResource +from ._models_py3 import TrustedAccessRole +from ._models_py3 import TrustedAccessRoleBinding +from ._models_py3 import TrustedAccessRoleBindingListResult +from ._models_py3 import TrustedAccessRoleListResult +from ._models_py3 import TrustedAccessRoleRule +from ._models_py3 import UpgradeOverrideSettings +from ._models_py3 import UserAssignedIdentity +from ._models_py3 import VirtualMachineNodes +from ._models_py3 import VirtualMachinesProfile +from ._models_py3 import WeeklySchedule +from ._models_py3 import WindowsGmsaProfile + +from ._container_service_client_enums import AddonAutoscaling +from ._container_service_client_enums import AgentPoolMode +from ._container_service_client_enums import AgentPoolSSHAccess +from ._container_service_client_enums import AgentPoolType +from ._container_service_client_enums import ArtifactSource +from ._container_service_client_enums import BackendPoolType +from ._container_service_client_enums import ClusterServiceLoadBalancerHealthProbeMode +from ._container_service_client_enums import Code +from ._container_service_client_enums import ConnectionStatus +from ._container_service_client_enums import CreatedByType +from ._container_service_client_enums import Expander +from ._container_service_client_enums import ExtendedLocationTypes +from ._container_service_client_enums import Format +from ._container_service_client_enums import GPUInstanceProfile +from ._container_service_client_enums import GuardrailsSupport +from ._container_service_client_enums import IpFamily +from ._container_service_client_enums import IpvsScheduler +from ._container_service_client_enums import IstioIngressGatewayMode +from ._container_service_client_enums import KeyVaultNetworkAccessTypes +from ._container_service_client_enums import KubeletDiskType +from ._container_service_client_enums import KubernetesSupportPlan +from ._container_service_client_enums import Level +from ._container_service_client_enums import LicenseType +from ._container_service_client_enums import LoadBalancerSku +from ._container_service_client_enums import ManagedClusterPodIdentityProvisioningState +from ._container_service_client_enums import ManagedClusterSKUName +from ._container_service_client_enums import ManagedClusterSKUTier +from ._container_service_client_enums import Mode +from ._container_service_client_enums import NetworkDataplane +from ._container_service_client_enums import NetworkMode +from ._container_service_client_enums import NetworkPlugin +from ._container_service_client_enums import NetworkPluginMode +from ._container_service_client_enums import NetworkPolicy +from ._container_service_client_enums import NodeOSUpgradeChannel +from ._container_service_client_enums import NodeProvisioningMode +from ._container_service_client_enums import OSDiskType +from ._container_service_client_enums import OSSKU +from ._container_service_client_enums import OSType +from ._container_service_client_enums import Operator +from ._container_service_client_enums import OutboundType +from ._container_service_client_enums import PodIPAllocationMode +from ._container_service_client_enums import PodLinkLocalAccess +from ._container_service_client_enums import PrivateEndpointConnectionProvisioningState +from ._container_service_client_enums import Protocol +from ._container_service_client_enums import PublicNetworkAccess +from ._container_service_client_enums import ResourceIdentityType +from ._container_service_client_enums import RestrictionLevel +from ._container_service_client_enums import SafeguardsSupport +from ._container_service_client_enums import ScaleDownMode +from ._container_service_client_enums import ScaleSetEvictionPolicy +from ._container_service_client_enums import ScaleSetPriority +from ._container_service_client_enums import ServiceMeshMode +from ._container_service_client_enums import SnapshotType +from ._container_service_client_enums import TrustedAccessRoleBindingProvisioningState +from ._container_service_client_enums import Type +from ._container_service_client_enums import UndrainableNodeBehavior +from ._container_service_client_enums import UpgradeChannel +from ._container_service_client_enums import WeekDay +from ._container_service_client_enums import WorkloadRuntime +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AbsoluteMonthlySchedule", + "AdvancedNetworking", + "AdvancedNetworkingObservability", + "AgentPool", + "AgentPoolArtifactStreamingProfile", + "AgentPoolAvailableVersions", + "AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem", + "AgentPoolDeleteMachinesParameter", + "AgentPoolGPUProfile", + "AgentPoolGatewayProfile", + "AgentPoolListResult", + "AgentPoolNetworkProfile", + "AgentPoolSecurityProfile", + "AgentPoolUpgradeProfile", + "AgentPoolUpgradeProfilePropertiesUpgradesItem", + "AgentPoolUpgradeSettings", + "AgentPoolWindowsProfile", + "AutoScaleProfile", + "AzureKeyVaultKms", + "CloudErrorBody", + "ClusterUpgradeSettings", + "CompatibleVersions", + "Component", + "ComponentsByReleases", + "ContainerServiceLinuxProfile", + "ContainerServiceNetworkProfile", + "ContainerServiceNetworkProfileKubeProxyConfig", + "ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig", + "ContainerServiceSshConfiguration", + "ContainerServiceSshPublicKey", + "CreationData", + "CredentialResult", + "CredentialResults", + "DailySchedule", + "DateSpan", + "DelegatedResource", + "EndpointDependency", + "EndpointDetail", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "ExtendedLocation", + "GuardrailsAvailableVersion", + "GuardrailsAvailableVersionsList", + "GuardrailsAvailableVersionsProperties", + "IPTag", + "IstioCertificateAuthority", + "IstioComponents", + "IstioEgressGateway", + "IstioIngressGateway", + "IstioPluginCertificateAuthority", + "IstioServiceMesh", + "KubeletConfig", + "KubernetesPatchVersion", + "KubernetesVersion", + "KubernetesVersionCapabilities", + "KubernetesVersionListResult", + "LabelSelector", + "LabelSelectorRequirement", + "LinuxOSConfig", + "LoadBalancer", + "LoadBalancerListResult", + "Machine", + "MachineIpAddress", + "MachineListResult", + "MachineNetworkProperties", + "MachineProperties", + "MaintenanceConfiguration", + "MaintenanceConfigurationListResult", + "MaintenanceWindow", + "ManagedCluster", + "ManagedClusterAADProfile", + "ManagedClusterAIToolchainOperatorProfile", + "ManagedClusterAPIServerAccessProfile", + "ManagedClusterAccessProfile", + "ManagedClusterAddonProfile", + "ManagedClusterAddonProfileIdentity", + "ManagedClusterAgentPoolProfile", + "ManagedClusterAgentPoolProfileProperties", + "ManagedClusterAutoUpgradeProfile", + "ManagedClusterAzureMonitorProfile", + "ManagedClusterAzureMonitorProfileAppMonitoring", + "ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation", + "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs", + "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics", + "ManagedClusterAzureMonitorProfileContainerInsights", + "ManagedClusterAzureMonitorProfileKubeStateMetrics", + "ManagedClusterAzureMonitorProfileMetrics", + "ManagedClusterBootstrapProfile", + "ManagedClusterCostAnalysis", + "ManagedClusterHTTPProxyConfig", + "ManagedClusterIdentity", + "ManagedClusterIngressProfile", + "ManagedClusterIngressProfileWebAppRouting", + "ManagedClusterListResult", + "ManagedClusterLoadBalancerProfile", + "ManagedClusterLoadBalancerProfileManagedOutboundIPs", + "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + "ManagedClusterLoadBalancerProfileOutboundIPs", + "ManagedClusterManagedOutboundIPProfile", + "ManagedClusterMetricsProfile", + "ManagedClusterNATGatewayProfile", + "ManagedClusterNodeProvisioningProfile", + "ManagedClusterNodeResourceGroupProfile", + "ManagedClusterOIDCIssuerProfile", + "ManagedClusterPodIdentity", + "ManagedClusterPodIdentityException", + "ManagedClusterPodIdentityProfile", + "ManagedClusterPodIdentityProvisioningError", + "ManagedClusterPodIdentityProvisioningErrorBody", + "ManagedClusterPodIdentityProvisioningInfo", + "ManagedClusterPoolUpgradeProfile", + "ManagedClusterPoolUpgradeProfileUpgradesItem", + "ManagedClusterPropertiesAutoScalerProfile", + "ManagedClusterPropertiesForSnapshot", + "ManagedClusterSKU", + "ManagedClusterSecurityProfile", + "ManagedClusterSecurityProfileDefender", + "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + "ManagedClusterSecurityProfileImageCleaner", + "ManagedClusterSecurityProfileImageIntegrity", + "ManagedClusterSecurityProfileNodeRestriction", + "ManagedClusterSecurityProfileWorkloadIdentity", + "ManagedClusterServicePrincipalProfile", + "ManagedClusterSnapshot", + "ManagedClusterSnapshotListResult", + "ManagedClusterStaticEgressGatewayProfile", + "ManagedClusterStorageProfile", + "ManagedClusterStorageProfileBlobCSIDriver", + "ManagedClusterStorageProfileDiskCSIDriver", + "ManagedClusterStorageProfileFileCSIDriver", + "ManagedClusterStorageProfileSnapshotController", + "ManagedClusterUpgradeProfile", + "ManagedClusterWindowsProfile", + "ManagedClusterWorkloadAutoScalerProfile", + "ManagedClusterWorkloadAutoScalerProfileKeda", + "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + "ManagedServiceIdentityUserAssignedIdentitiesValue", + "ManualScaleProfile", + "MeshRevision", + "MeshRevisionProfile", + "MeshRevisionProfileList", + "MeshRevisionProfileProperties", + "MeshUpgradeProfile", + "MeshUpgradeProfileList", + "MeshUpgradeProfileProperties", + "NetworkMonitoring", + "NetworkProfileForSnapshot", + "OSOptionProfile", + "OSOptionProperty", + "OperationListResult", + "OperationStatusResult", + "OperationStatusResultList", + "OperationValue", + "OutboundEnvironmentEndpoint", + "OutboundEnvironmentEndpointCollection", + "PortRange", + "PowerState", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourcesListResult", + "PrivateLinkServiceConnectionState", + "ProxyResource", + "RebalanceLoadBalancersRequestBody", + "RelativeMonthlySchedule", + "Resource", + "ResourceReference", + "RunCommandRequest", + "RunCommandResult", + "SafeguardsAvailableVersion", + "SafeguardsAvailableVersionsList", + "SafeguardsAvailableVersionsProperties", + "SafeguardsProfile", + "ScaleProfile", + "Schedule", + "ServiceMeshProfile", + "Snapshot", + "SnapshotListResult", + "SubResource", + "SysctlConfig", + "SystemData", + "TagsObject", + "TimeInWeek", + "TimeSpan", + "TrackedResource", + "TrustedAccessRole", + "TrustedAccessRoleBinding", + "TrustedAccessRoleBindingListResult", + "TrustedAccessRoleListResult", + "TrustedAccessRoleRule", + "UpgradeOverrideSettings", + "UserAssignedIdentity", + "VirtualMachineNodes", + "VirtualMachinesProfile", + "WeeklySchedule", + "WindowsGmsaProfile", + "AddonAutoscaling", + "AgentPoolMode", + "AgentPoolSSHAccess", + "AgentPoolType", + "ArtifactSource", + "BackendPoolType", + "ClusterServiceLoadBalancerHealthProbeMode", + "Code", + "ConnectionStatus", + "CreatedByType", + "Expander", + "ExtendedLocationTypes", + "Format", + "GPUInstanceProfile", + "GuardrailsSupport", + "IpFamily", + "IpvsScheduler", + "IstioIngressGatewayMode", + "KeyVaultNetworkAccessTypes", + "KubeletDiskType", + "KubernetesSupportPlan", + "Level", + "LicenseType", + "LoadBalancerSku", + "ManagedClusterPodIdentityProvisioningState", + "ManagedClusterSKUName", + "ManagedClusterSKUTier", + "Mode", + "NetworkDataplane", + "NetworkMode", + "NetworkPlugin", + "NetworkPluginMode", + "NetworkPolicy", + "NodeOSUpgradeChannel", + "NodeProvisioningMode", + "OSDiskType", + "OSSKU", + "OSType", + "Operator", + "OutboundType", + "PodIPAllocationMode", + "PodLinkLocalAccess", + "PrivateEndpointConnectionProvisioningState", + "Protocol", + "PublicNetworkAccess", + "ResourceIdentityType", + "RestrictionLevel", + "SafeguardsSupport", + "ScaleDownMode", + "ScaleSetEvictionPolicy", + "ScaleSetPriority", + "ServiceMeshMode", + "SnapshotType", + "TrustedAccessRoleBindingProvisioningState", + "Type", + "UndrainableNodeBehavior", + "UpgradeChannel", + "WeekDay", + "WorkloadRuntime", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_container_service_client_enums.py new file mode 100644 index 000000000000..7e9fb776185f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_container_service_client_enums.py @@ -0,0 +1,762 @@ +# 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 enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AddonAutoscaling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether VPA add-on is enabled and configured to scale AKS-managed add-ons.""" + + ENABLED = "Enabled" + """Feature to autoscale AKS-managed add-ons is enabled. The default VPA update mode is Initial + mode.""" + DISABLED = "Disabled" + """Feature to autoscale AKS-managed add-ons is disabled.""" + + +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: + https://docs.microsoft.com/azure/aks/use-system-pools. + """ + + SYSTEM = "System" + """System agent pools are primarily for hosting critical system pods such as CoreDNS and + metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at + least 2vCPUs and 4GB of memory.""" + USER = "User" + """User agent pools are primarily for hosting your application pods.""" + GATEWAY = "Gateway" + """Gateway agent pools are dedicated to providing static egress IPs to pods. For more details, see + https://aka.ms/aks/static-egress-gateway.""" + + +class AgentPoolSSHAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SSH access method of an agent pool.""" + + LOCAL_USER = "LocalUser" + """Can SSH onto the node as a local user using private key.""" + DISABLED = "Disabled" + """SSH service will be turned off on the node.""" + + +class AgentPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of Agent Pool.""" + + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + """Create an Agent Pool backed by a Virtual Machine Scale Set.""" + AVAILABILITY_SET = "AvailabilitySet" + """Use of this is strongly discouraged.""" + VIRTUAL_MACHINES = "VirtualMachines" + """Create an Agent Pool backed by a Single Instance VM orchestration mode.""" + + +class ArtifactSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The source where the artifacts are downloaded from.""" + + CACHE = "Cache" + """pull images from Azure Container Registry with cache""" + DIRECT = "Direct" + """pull images from Microsoft Artifact Registry""" + + +class BackendPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the managed inbound Load Balancer BackendPool.""" + + NODE_IP_CONFIGURATION = "NodeIPConfiguration" + """The type of the managed inbound Load Balancer BackendPool. + https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend.""" + NODE_IP = "NodeIP" + """The type of the managed inbound Load Balancer BackendPool. + https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend.""" + + +class ClusterServiceLoadBalancerHealthProbeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The health probing behavior for External Traffic Policy Cluster services.""" + + SERVICE_NODE_PORT = "ServiceNodePort" + """Each External Traffic Policy Cluster service will have its own health probe targeting service + nodePort.""" + SHARED = "Shared" + """All External Traffic Policy Cluster services in a Standard Load Balancer will have a dedicated + health probe targeting the backend nodes' kube-proxy health check port 10256.""" + + +class Code(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tells whether the cluster is Running or Stopped.""" + + RUNNING = "Running" + """The cluster is running.""" + STOPPED = "Stopped" + """The cluster is stopped.""" + + +class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The private link service connection status.""" + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class Expander(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """If not specified, the default is 'random'. See `expanders + `_ + for more information. + """ + + LEAST_WASTE = "least-waste" + """Selects the node group that will have the least idle CPU (if tied, unused memory) after + scale-up. This is useful when you have different classes of nodes, for example, high CPU or + high memory nodes, and only want to expand those when there are pending pods that need a lot of + those resources.""" + MOST_PODS = "most-pods" + """Selects the node group that would be able to schedule the most pods when scaling up. This is + useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note + that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple + smaller nodes at once.""" + PRIORITY = "priority" + """Selects the node group that has the highest priority assigned by the user. It's configuration + is described in more details `here + `_.""" + RANDOM = "random" + """Used when you don't have a particular need for the node groups to scale differently.""" + + +class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of extendedLocation.""" + + EDGE_ZONE = "EdgeZone" + + +class Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Format.""" + + AZURE = "azure" + """Return azure auth-provider kubeconfig. This format is deprecated in v1.22 and will be fully + removed in v1.26. See: https://aka.ms/k8s/changes-1-26.""" + EXEC_ENUM = "exec" + """Return exec format kubeconfig. This format requires kubelogin binary in the path.""" + + +class GPUInstanceProfile(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.""" + + MIG1_G = "MIG1g" + MIG2_G = "MIG2g" + MIG3_G = "MIG3g" + MIG4_G = "MIG4g" + MIG7_G = "MIG7g" + + +class GuardrailsSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the version is preview or stable.""" + + PREVIEW = "Preview" + """The version is preview. It is not recommended to use preview versions on critical production + clusters. The preview version may not support all use-cases.""" + STABLE = "Stable" + """The version is stable and can be used on critical production clusters.""" + + +class IpFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """To determine if address belongs IPv4 or IPv6 family.""" + + I_PV4 = "IPv4" + """IPv4 family""" + I_PV6 = "IPv6" + """IPv6 family""" + + +class IpvsScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. + """ + + ROUND_ROBIN = "RoundRobin" + """Round Robin""" + LEAST_CONNECTION = "LeastConnection" + """Least Connection""" + + +class IstioIngressGatewayMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mode of an ingress gateway.""" + + EXTERNAL = "External" + """The ingress gateway is assigned a public IP address and is publicly accessible.""" + INTERNAL = "Internal" + """The ingress gateway is assigned an internal IP address and cannot is accessed publicly.""" + + +class KeyVaultNetworkAccessTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network access of key vault. The possible values are ``Public`` and ``Private``. ``Public`` + means the key vault allows public access from all networks. ``Private`` means the key vault + disables public access and enables private link. The default value is ``Public``. + """ + + PUBLIC = "Public" + PRIVATE = "Private" + + +class KubeletDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet + ephemeral storage. + """ + + OS = "OS" + """Kubelet will use the OS disk for its data.""" + TEMPORARY = "Temporary" + """Kubelet will use the temporary disk for its data.""" + + +class KubernetesSupportPlan(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Different support tiers for AKS managed clusters.""" + + KUBERNETES_OFFICIAL = "KubernetesOfficial" + """Support for the version is the same as for the open source Kubernetes offering. Official + Kubernetes open source community support versions for 1 year after release.""" + AKS_LONG_TERM_SUPPORT = "AKSLongTermSupport" + """Support for the version extended past the KubernetesOfficial support of 1 year. AKS continues + to patch CVEs for another 1 year, for a total of 2 years of support.""" + + +class Level(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except + those that AKS excludes via systemExcludedNamespaces. + """ + + OFF = "Off" + WARNING = "Warning" + ENFORCEMENT = "Enforcement" + + +class LicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. + """ + + NONE = "None" + """No additional licensing is applied.""" + WINDOWS_SERVER = "Windows_Server" + """Enables Azure Hybrid User Benefits for Windows VMs.""" + + +class LoadBalancerSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The default is 'standard'. See `Azure Load Balancer SKUs + `_ for more information about the + differences between load balancer SKUs. + """ + + STANDARD = "standard" + """Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For more information + about on working with the load balancer in the managed cluster, see the `standard Load Balancer + `_ article.""" + BASIC = "basic" + """Use a basic Load Balancer with limited functionality.""" + + +class ManagedClusterPodIdentityProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of the pod identity.""" + + ASSIGNED = "Assigned" + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + +class ManagedClusterSKUName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The name of a managed cluster SKU.""" + + BASE = "Base" + """Base option for the AKS control plane.""" + AUTOMATIC = "Automatic" + """Automatic clusters are optimized to run most production workloads with configuration that + follows AKS best practices and recommendations for cluster and workload setup, scalability, and + security. For more details about Automatic clusters see aka.ms/aks/automatic.""" + + +class ManagedClusterSKUTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """If not specified, the default is 'Free'. See `AKS Pricing Tier + `_ for more details. + """ + + PREMIUM = "Premium" + """Cluster has premium capabilities in addition to all of the capabilities included in 'Standard'. + Premium enables selection of LongTermSupport (aka.ms/aks/lts) for certain Kubernetes versions.""" + STANDARD = "Standard" + """Recommended for mission-critical and production workloads. Includes Kubernetes control plane + autoscaling, workload-intensive testing, and up to 5,000 nodes per cluster. Guarantees 99.95% + availability of the Kubernetes API server endpoint for clusters that use Availability Zones and + 99.9% of availability for clusters that don't use Availability Zones.""" + FREE = "Free" + """The cluster management is free, but charged for VM, storage, and networking usage. Best for + experimenting, learning, simple testing, or workloads with fewer than 10 nodes. Not recommended + for production use cases.""" + + +class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify which proxy mode to use ('IPTABLES' or 'IPVS').""" + + IPTABLES = "IPTABLES" + """IPTables proxy mode""" + IPVS = "IPVS" + """IPVS proxy mode. Must be using Kubernetes version >= 1.22.""" + + +class NetworkDataplane(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network dataplane used in the Kubernetes cluster.""" + + AZURE = "azure" + """Use Azure network dataplane.""" + CILIUM = "cilium" + """Use Cilium network dataplane. See `Azure CNI Powered by Cilium + `_ for more information.""" + + +class NetworkMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This cannot be specified if networkPlugin is anything other than 'azure'.""" + + TRANSPARENT = "transparent" + """No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure + CNI. See `Transparent Mode `_ for + more information.""" + BRIDGE = "bridge" + """This is no longer supported""" + + +class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network plugin used for building the Kubernetes network.""" + + AZURE = "azure" + """Use the Azure CNI network plugin. See `Azure CNI (advanced) networking + `_ for + more information.""" + KUBENET = "kubenet" + """Use the Kubenet network plugin. See `Kubenet (basic) networking + `_ for more + information.""" + NONE = "none" + """Do not use a network plugin. A custom CNI will need to be installed after cluster creation for + networking functionality.""" + + +class NetworkPluginMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The mode the network plugin should use.""" + + OVERLAY = "overlay" + """Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than + Kubenet reference plugins host-local and bridge.""" + + +class NetworkPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network policy used for building the Kubernetes network.""" + + NONE = "none" + """Network policies will not be enforced. This is the default value when NetworkPolicy is not + specified.""" + CALICO = "calico" + """Use Calico network policies. See `differences between Azure and Calico policies + `_ + for more information.""" + AZURE = "azure" + """Use Azure network policies. See `differences between Azure and Calico policies + `_ + for more information.""" + CILIUM = "cilium" + """Use Cilium to enforce network policies. This requires networkDataplane to be 'cilium'.""" + + +class NodeOSUpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA.""" + + NONE = "None" + """No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means + you are responsible for your security updates""" + UNMANAGED = "Unmanaged" + """OS updates will be applied automatically through the OS built-in patching infrastructure. Newly + scaled in machines will be unpatched initially, and will be patched at some later time by the + OS's infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner + apply security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows + does not apply security patches automatically and so for them this option is equivalent to None + till further notice""" + SECURITY_PATCH = "SecurityPatch" + """AKS will update the nodes VHD with patches from the image maintainer labelled "security only" + on a regular basis. Where possible, patches will also be applied without reimaging to existing + nodes. Some patches, such as kernel patches, cannot be applied to existing nodes without + disruption. For such patches, the VHD will be updated, and machines will be rolling reimaged to + that VHD following maintenance windows and surge settings. This option incurs the extra cost of + hosting the VHDs in your node resource group.""" + NODE_IMAGE = "NodeImage" + """AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a + weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following + maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option + as AKS hosts the images.""" + + +class NodeProvisioningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Once the mode it set to Auto, it cannot be changed back to Manual.""" + + MANUAL = "Manual" + """Nodes are provisioned manually by the user""" + AUTO = "Auto" + """Nodes are provisioned automatically by AKS using Karpenter. Fixed size Node Pools can still be + created, but autoscaling Node Pools cannot be. (See aka.ms/aks/nap for more details).""" + + +class Operator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """operator represents a key's relationship to a set of values. Valid operators are In and NotIn.""" + + IN_ENUM = "In" + """The value of the key should be in the given list.""" + NOT_IN = "NotIn" + """The value of the key should not be in the given list.""" + EXISTS = "Exists" + """The value of the key should exist.""" + DOES_NOT_EXIST = "DoesNotExist" + """The value of the key should not exist.""" + + +class OSDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """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 + `_. + """ + + MANAGED = "Managed" + """Azure replicates the operating system disk for a virtual machine to Azure storage to avoid data + loss should the VM need to be relocated to another host. Since containers aren't designed to + have local state persisted, this behavior offers limited value while providing some drawbacks, + including slower node provisioning and higher read/write latency.""" + EPHEMERAL = "Ephemeral" + """Ephemeral OS disks are stored only on the host machine, just like a temporary disk. This + provides lower read/write latency, along with faster node scaling and cluster upgrades.""" + + +class OSSKU(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """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. + """ + + UBUNTU = "Ubuntu" + """Use Ubuntu as the OS for node images.""" + MARINER = "Mariner" + """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" + AZURE_LINUX = "AzureLinux" + """Use AzureLinux as the OS for node images. Azure Linux is a container-optimized Linux distro + built by Microsoft, visit https://aka.ms/azurelinux for more information.""" + CBL_MARINER = "CBLMariner" + """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" + WINDOWS2019 = "Windows2019" + """Use Windows2019 as the OS for node images. Unsupported for system node pools. Windows2019 only + supports Windows2019 containers; it cannot run Windows2022 containers and vice versa.""" + 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.""" + WINDOWS_ANNUAL = "WindowsAnnual" + """Use Windows Annual Channel version as the OS for node images. Unsupported for system node + pools. Details about supported container images and kubernetes versions under different AKS + Annual Channel versions could be seen in https://aka.ms/aks/windows-annual-channel-details.""" + + +class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operating system type. The default is Linux.""" + + LINUX = "Linux" + """Use Linux.""" + WINDOWS = "Windows" + """Use Windows.""" + + +class OutboundType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This can only be set at cluster creation time and cannot be changed later. For more information + see `egress outbound type `_. + """ + + LOAD_BALANCER = "loadBalancer" + """The load balancer is used for egress through an AKS assigned public IP. This supports + Kubernetes services of type 'loadBalancer'. For more information see `outbound type + loadbalancer + `_.""" + USER_DEFINED_ROUTING = "userDefinedRouting" + """Egress paths must be defined by the user. This is an advanced scenario and requires proper + network configuration. For more information see `outbound type userDefinedRouting + `_.""" + MANAGED_NAT_GATEWAY = "managedNATGateway" + """The AKS-managed NAT gateway is used for egress.""" + USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" + """The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an + advanced scenario and requires proper network configuration.""" + NONE = "none" + """The AKS cluster is not set with any outbound-type. All AKS nodes follows Azure VM default + outbound behavior. Please refer to + https://azure.microsoft.com/en-us/updates/default-outbound-access-for-vms-in-azure-will-be-retired-transition-to-a-new-method-of-internet-access/""" + + +class PodIPAllocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default + is 'DynamicIndividual'. + """ + + DYNAMIC_INDIVIDUAL = "DynamicIndividual" + """Each pod gets a single IP address assigned. This is better for maximizing a small to medium + subnet of size /16 or smaller. The Azure CNI cluster with dynamic IP allocation defaults to + this mode if the customer does not explicitly specify a podIPAllocationMode""" + STATIC_BLOCK = "StaticBlock" + """Each node is statically allocated CIDR block(s) of size /28 = 16 IPs per block to satisfy the + maxPods per node. Number of CIDR blocks >= (maxPods / 16). The block, rather than a single IP, + counts against the Azure Vnet Private IP limit of 65K. Therefore block mode is suitable for + running larger workloads with more than the current limit of 65K pods in a cluster. This mode + is better suited to scale with larger subnets of /15 or bigger""" + + +class PodLinkLocalAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """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'. + """ + + IMDS = "IMDS" + """Pods with hostNetwork=false can access Azure Instance Metadata Service (IMDS) without + restriction.""" + NONE = "None" + """Pods with hostNetwork=false cannot access Azure Instance Metadata Service (IMDS).""" + + +class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + CANCELED = "Canceled" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + +class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The network protocol of the port.""" + + TCP = "TCP" + """TCP protocol.""" + UDP = "UDP" + """UDP protocol.""" + + +class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allow or deny public network access for AKS.""" + + ENABLED = "Enabled" + """Inbound/Outbound to the managedCluster is allowed.""" + DISABLED = "Disabled" + """Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed.""" + SECURED_BY_PERIMETER = "SecuredByPerimeter" + """Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters.""" + + +class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """For more information see `use managed identities in AKS + `_. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + """Use an implicitly created system assigned managed identity to manage cluster resources. Master + components in the control plane such as kube-controller-manager will use the system assigned + managed identity to manipulate Azure resources.""" + USER_ASSIGNED = "UserAssigned" + """Use a user-specified identity to manage cluster resources. Master components in the control + plane such as kube-controller-manager will use the specified user assigned managed identity to + manipulate Azure resources.""" + NONE = "None" + """Do not use a managed identity for the Managed Cluster, service principal will be used instead.""" + + +class RestrictionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The restriction level applied to the cluster's node resource group.""" + + UNRESTRICTED = "Unrestricted" + """All RBAC permissions are allowed on the managed node resource group""" + READ_ONLY = "ReadOnly" + """Only */read RBAC permissions allowed on the managed node resource group""" + + +class SafeguardsSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Whether the version is preview or stable.""" + + PREVIEW = "Preview" + """The version is preview. It is not recommended to use preview versions on critical production + clusters. The preview version may not support all use-cases.""" + STABLE = "Stable" + """The version is stable and can be used on critical production clusters.""" + + +class ScaleDownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes how VMs are added to or removed from Agent Pools. See `billing states + `_. + """ + + DELETE = "Delete" + """Create new instances during scale up and remove instances during scale down.""" + DEALLOCATE = "Deallocate" + """Attempt to start deallocated instances (if they exist) during scale up and deallocate instances + during scale down.""" + + +class ScaleSetEvictionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. + For more information about eviction see `spot VMs + `_. + """ + + DELETE = "Delete" + """Nodes in the underlying Scale Set of the node pool are deleted when they're evicted.""" + DEALLOCATE = "Deallocate" + """Nodes in the underlying Scale Set of the node pool are set to the stopped-deallocated state + upon eviction. Nodes in the stopped-deallocated state count against your compute quota and can + cause issues with cluster scaling or upgrading.""" + + +class ScaleSetPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Virtual Machine Scale Set priority.""" + + SPOT = "Spot" + """Spot priority VMs will be used. There is no SLA for spot nodes. See `spot on AKS + `_ for more information.""" + REGULAR = "Regular" + """Regular VMs will be used.""" + + +class ServiceMeshMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Mode of the service mesh.""" + + ISTIO = "Istio" + """Istio deployed as an AKS addon.""" + DISABLED = "Disabled" + """Mesh is disabled.""" + + +class SnapshotType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a snapshot. The default is NodePool.""" + + NODE_POOL = "NodePool" + """The snapshot is a snapshot of a node pool.""" + MANAGED_CLUSTER = "ManagedCluster" + """The snapshot is a snapshot of a managed cluster.""" + + +class TrustedAccessRoleBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of trusted access role binding.""" + + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + +class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs.""" + + FIRST = "First" + """First.""" + SECOND = "Second" + """Second.""" + THIRD = "Third" + """Third.""" + FOURTH = "Fourth" + """Fourth.""" + LAST = "Last" + """Last.""" + + +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 + `_. + """ + + RAPID = "rapid" + """Automatically upgrade the cluster to the latest supported patch release on the latest supported + minor version. In cases where the cluster is at a version of Kubernetes that is at an N-2 minor + version where N is the latest supported minor version, the cluster first upgrades to the latest + supported patch version on N-1 minor version. For example, if a cluster is running version + 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is + upgraded to 1.18.6, then is upgraded to 1.19.1.""" + STABLE = "stable" + """Automatically upgrade the cluster to the latest supported patch release on minor version N-1, + where N is the latest supported minor version. For example, if a cluster is running version + 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded + to 1.18.6.""" + PATCH = "patch" + """Automatically upgrade the cluster to the latest supported patch version when it becomes + available while keeping the minor version the same. For example, if a cluster is running + version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is + upgraded to 1.17.9.""" + NODE_IMAGE = "node-image" + """Automatically upgrade the node image to the latest version available. Consider using + nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from + Kubernetes version patching""" + NONE = "none" + """Disables auto-upgrades and keeps the cluster at its current version of Kubernetes.""" + + +class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The weekday enum.""" + + SUNDAY = "Sunday" + MONDAY = "Monday" + TUESDAY = "Tuesday" + WEDNESDAY = "Wednesday" + THURSDAY = "Thursday" + FRIDAY = "Friday" + SATURDAY = "Saturday" + + +class WorkloadRuntime(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Determines the type of workload a node can run.""" + + OCI_CONTAINER = "OCIContainer" + """Nodes will use Kubelet to run standard OCI container workloads.""" + WASM_WASI = "WasmWasi" + """Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview).""" + KATA_MSHV_VM_ISOLATION = "KataMshvVmIsolation" + """Nodes can use (Kata + Cloud Hypervisor + Hyper-V) to enable Nested VM-based pods (Preview). Due + to the use Hyper-V, AKS node OS itself is a nested VM (the root OS) of Hyper-V. Thus it can + only be used with VM series that support Nested Virtualization such as Dv3 series.""" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_models_py3.py new file mode 100644 index 000000000000..17fbfd8b35ab --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_models_py3.py @@ -0,0 +1,10854 @@ +# coding=utf-8 +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union + +from ... import _serialization + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +class AbsoluteMonthlySchedule(_serialization.Model): + """For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + + All required parameters must be populated in order to send to server. + + :ivar interval_months: Specifies the number of months between each set of occurrences. + Required. + :vartype interval_months: int + :ivar day_of_month: The date of the month. Required. + :vartype day_of_month: int + """ + + _validation = { + "interval_months": {"required": True, "maximum": 6, "minimum": 1}, + "day_of_month": {"required": True, "maximum": 31, "minimum": 1}, + } + + _attribute_map = { + "interval_months": {"key": "intervalMonths", "type": "int"}, + "day_of_month": {"key": "dayOfMonth", "type": "int"}, + } + + def __init__(self, *, interval_months: int, day_of_month: int, **kwargs: Any) -> None: + """ + :keyword interval_months: Specifies the number of months between each set of occurrences. + Required. + :paramtype interval_months: int + :keyword day_of_month: The date of the month. Required. + :paramtype day_of_month: int + """ + super().__init__(**kwargs) + self.interval_months = interval_months + self.day_of_month = day_of_month + + +class AdvancedNetworking(_serialization.Model): + """Advanced Networking profile for enabling observability on a cluster. Note that enabling + advanced networking features may incur additional costs. For more information see + aka.ms/aksadvancednetworking. + + :ivar observability: Observability profile to enable advanced network metrics and flow logs + with historical contexts. + :vartype observability: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AdvancedNetworkingObservability + """ + + _attribute_map = { + "observability": {"key": "observability", "type": "AdvancedNetworkingObservability"}, + } + + def __init__( + self, *, observability: Optional["_models.AdvancedNetworkingObservability"] = None, **kwargs: Any + ) -> None: + """ + :keyword observability: Observability profile to enable advanced network metrics and flow logs + with historical contexts. + :paramtype observability: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AdvancedNetworkingObservability + """ + super().__init__(**kwargs) + self.observability = observability + + +class AdvancedNetworkingObservability(_serialization.Model): + """Observability profile to enable advanced network metrics and flow logs with historical + contexts. + + :ivar enabled: Indicates the enablement of Advanced Networking observability functionalities on + clusters. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates the enablement of Advanced Networking observability functionalities + on clusters. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class SubResource(_serialization.Model): + """Reference to another subresource. + + 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 + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AgentPool(SubResource): # pylint: disable=too-many-instance-attributes + """Agent Pool. + + 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 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_04_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.v2024_04_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.v2024_04_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_04_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.v2024_04_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.v2024_04_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_04_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.v2024_04_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.v2024_04_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_04_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.v2024_04_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_04_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_04_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_04_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.v2024_04_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 + 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.v2024_04_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.AgentPoolGatewayProfile + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "e_tag": {"readonly": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "e_tag": {"key": "properties.eTag", "type": "str"}, + "count": {"key": "properties.count", "type": "int"}, + "vm_size": {"key": "properties.vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "properties.osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "properties.osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "properties.kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "properties.workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "properties.messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "properties.vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "properties.podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "properties.podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "properties.maxPods", "type": "int"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "os_sku": {"key": "properties.osSKU", "type": "str"}, + "max_count": {"key": "properties.maxCount", "type": "int"}, + "min_count": {"key": "properties.minCount", "type": "int"}, + "enable_auto_scaling": {"key": "properties.enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "properties.scaleDownMode", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "mode": {"key": "properties.mode", "type": "str"}, + "orchestrator_version": {"key": "properties.orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "properties.currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "properties.nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "properties.upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "power_state": {"key": "properties.powerState", "type": "PowerState"}, + "availability_zones": {"key": "properties.availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "properties.enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "properties.enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "properties.nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "properties.scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "properties.scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "properties.spotMaxPrice", "type": "float"}, + "tags": {"key": "properties.tags", "type": "{str}"}, + "node_labels": {"key": "properties.nodeLabels", "type": "{str}"}, + "node_taints": {"key": "properties.nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "properties.nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "properties.proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "properties.kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "properties.linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "properties.enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "properties.enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "properties.enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "properties.gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "properties.capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "properties.hostGroupID", "type": "str"}, + "windows_profile": {"key": "properties.windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "properties.networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "properties.securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "properties.gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": { + "key": "properties.artifactStreamingProfile", + "type": "AgentPoolArtifactStreamingProfile", + }, + "virtual_machines_profile": {"key": "properties.virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": { + "key": "properties.virtualMachineNodesStatus", + "type": "[VirtualMachineNodes]", + }, + "gateway_profile": {"key": "properties.gatewayProfile", "type": "AgentPoolGatewayProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type_properties_type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_04_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.v2024_04_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.v2024_04_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_04_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.v2024_04_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.v2024_04_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_04_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.v2024_04_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.v2024_04_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_04_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.v2024_04_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_04_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_04_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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 + 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.v2024_04_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.AgentPoolGatewayProfile + """ + super().__init__(**kwargs) + self.e_tag = None + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.message_of_the_day = message_of_the_day + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.pod_ip_allocation_mode = pod_ip_allocation_mode + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + 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.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = power_state + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.enable_custom_ca_trust = enable_custom_ca_trust + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.node_initialization_taints = node_initialization_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + self.capacity_reservation_group_id = capacity_reservation_group_id + self.host_group_id = host_group_id + self.windows_profile = windows_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.gpu_profile = gpu_profile + self.artifact_streaming_profile = artifact_streaming_profile + self.virtual_machines_profile = virtual_machines_profile + self.virtual_machine_nodes_status = virtual_machine_nodes_status + self.gateway_profile = gateway_profile + + +class AgentPoolArtifactStreamingProfile(_serialization.Model): + """AgentPoolArtifactStreamingProfile. + + :ivar enabled: Artifact streaming speeds up the cold-start of containers on a node through + on-demand image loading. To use this feature, container images must also enable artifact + streaming on ACR. If not specified, the default is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Artifact streaming speeds up the cold-start of containers on a node through + on-demand image loading. To use this feature, container images must also enable artifact + streaming on ACR. If not specified, the default is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class AgentPoolAvailableVersions(_serialization.Model): + """The list of available versions for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the agent pool version list. + :vartype id: str + :ivar name: The name of the agent pool version list. + :vartype name: str + :ivar type: Type of the agent pool version list. + :vartype type: str + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] # pylint: disable=line-too-long + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "agent_pool_versions": { + "key": "properties.agentPoolVersions", + "type": "[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]", + }, + } + + def __init__( + self, + *, + agent_pool_versions: Optional[List["_models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.agent_pool_versions = agent_pool_versions + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(_serialization.Model): # pylint: disable=name-too-long + """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. + + :ivar default: Whether this version is the default agent pool version. + :vartype default: bool + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "default": {"key": "default", "type": "bool"}, + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword default: Whether this version is the default agent pool version. + :paramtype default: bool + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.default = default + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolDeleteMachinesParameter(_serialization.Model): + """Specifies a list of machine names from the agent pool to be deleted. + + All required parameters must be populated in order to send to server. + + :ivar machine_names: The agent pool machine names. Required. + :vartype machine_names: list[str] + """ + + _validation = { + "machine_names": {"required": True}, + } + + _attribute_map = { + "machine_names": {"key": "machineNames", "type": "[str]"}, + } + + def __init__(self, *, machine_names: List[str], **kwargs: Any) -> None: + """ + :keyword machine_names: The agent pool machine names. Required. + :paramtype machine_names: list[str] + """ + super().__init__(**kwargs) + self.machine_names = machine_names + + +class AgentPoolGatewayProfile(_serialization.Model): + """Profile of the managed cluster gateway agent pool. + + :ivar public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each + static egress gateway to provide public egress. The size of Public IPPrefix should be selected + by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The + IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public + IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 + nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + :vartype public_ip_prefix_size: int + """ + + _validation = { + "public_ip_prefix_size": {"maximum": 31, "minimum": 28}, + } + + _attribute_map = { + "public_ip_prefix_size": {"key": "publicIPPrefixSize", "type": "int"}, + } + + def __init__(self, *, public_ip_prefix_size: int = 31, **kwargs: Any) -> None: + """ + :keyword public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each + static egress gateway to provide public egress. The size of Public IPPrefix should be selected + by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The + IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public + IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 + nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + :paramtype public_ip_prefix_size: int + """ + super().__init__(**kwargs) + self.public_ip_prefix_size = public_ip_prefix_size + + +class AgentPoolGPUProfile(_serialization.Model): + """AgentPoolGPUProfile. + + :ivar install_gpu_driver: The default value is true when the vmSize of the agent pool contains + a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an associated + GPU resource. Setting this field to false prevents automatic GPU driver installation. In that + case, in order for the GPU to be usable, the user must perform GPU driver installation + themselves. + :vartype install_gpu_driver: bool + """ + + _attribute_map = { + "install_gpu_driver": {"key": "installGPUDriver", "type": "bool"}, + } + + def __init__(self, *, install_gpu_driver: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword install_gpu_driver: The default value is true when the vmSize of the agent pool + contains a GPU, false otherwise. GPU Driver Installation can only be set true when VM has an + associated GPU resource. Setting this field to false prevents automatic GPU driver + installation. In that case, in order for the GPU to be usable, the user must perform GPU driver + installation themselves. + :paramtype install_gpu_driver: bool + """ + super().__init__(**kwargs) + self.install_gpu_driver = install_gpu_driver + + +class AgentPoolListResult(_serialization.Model): + """The response from the List Agent Pools operation. + + 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.v2024_04_02_preview.models.AgentPool] + :ivar next_link: The URL to get the next set of agent pool results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[AgentPool]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_04_02_preview.models.AgentPool] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = 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.v2024_04_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.v2024_04_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] + """ + + _attribute_map = { + "node_public_ip_tags": {"key": "nodePublicIPTags", "type": "[IPTag]"}, + "allowed_host_ports": {"key": "allowedHostPorts", "type": "[PortRange]"}, + "application_security_groups": {"key": "applicationSecurityGroups", "type": "[str]"}, + } + + def __init__( + self, + *, + node_public_ip_tags: Optional[List["_models.IPTag"]] = None, + allowed_host_ports: Optional[List["_models.PortRange"]] = None, + application_security_groups: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword node_public_ip_tags: IPTags of instance-level public IPs. + :paramtype node_public_ip_tags: + list[~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + """ + super().__init__(**kwargs) + self.node_public_ip_tags = node_public_ip_tags + self.allowed_host_ports = allowed_host_ports + self.application_security_groups = application_security_groups + + +class AgentPoolSecurityProfile(_serialization.Model): + """The security settings of an agent pool. + + :ivar ssh_access: SSH access method of an agent pool. Known values are: "LocalUser" and + "Disabled". + :vartype ssh_access: str or + ~azure.mgmt.containerservice.v2024_04_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. + :vartype enable_vtpm: bool + :ivar enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only + signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. + If not specified, the default is false. + :vartype enable_secure_boot: bool + """ + + _attribute_map = { + "ssh_access": {"key": "sshAccess", "type": "str"}, + "enable_vtpm": {"key": "enableVTPM", "type": "bool"}, + "enable_secure_boot": {"key": "enableSecureBoot", "type": "bool"}, + } + + def __init__( + self, + *, + ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = None, + enable_vtpm: Optional[bool] = None, + enable_secure_boot: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword ssh_access: SSH access method of an agent pool. Known values are: "LocalUser" and + "Disabled". + :paramtype ssh_access: str or + ~azure.mgmt.containerservice.v2024_04_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. + :paramtype enable_vtpm: bool + :keyword enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only + signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. + If not specified, the default is false. + :paramtype enable_secure_boot: bool + """ + super().__init__(**kwargs) + self.ssh_access = ssh_access + self.enable_vtpm = enable_vtpm + self.enable_secure_boot = enable_secure_boot + + +class AgentPoolUpgradeProfile(_serialization.Model): + """The list of available upgrades for an agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the agent pool upgrade profile. + :vartype id: str + :ivar name: The name of the agent pool upgrade profile. + :vartype name: str + :ivar type: The type of the agent pool upgrade profile. + :vartype type: str + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :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.v2024_04_02_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :ivar components_by_releases: components of given Kubernetes version. + :vartype components_by_releases: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ComponentsByReleases + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "kubernetes_version": {"required": True}, + "os_type": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "upgrades": {"key": "properties.upgrades", "type": "[AgentPoolUpgradeProfilePropertiesUpgradesItem]"}, + "components_by_releases": {"key": "properties.componentsByReleases", "type": "ComponentsByReleases"}, + "latest_node_image_version": {"key": "properties.latestNodeImageVersion", "type": "str"}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "_models.OSType"] = "Linux", + upgrades: Optional[List["_models.AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + components_by_releases: Optional["_models.ComponentsByReleases"] = None, + latest_node_image_version: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :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.v2024_04_02_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :keyword components_by_releases: components of given Kubernetes version. + :paramtype components_by_releases: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ComponentsByReleases + :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.kubernetes_version = kubernetes_version + self.os_type = os_type + self.upgrades = upgrades + self.components_by_releases = components_by_releases + self.latest_node_image_version = latest_node_image_version + + +class AgentPoolUpgradeProfilePropertiesUpgradesItem(_serialization.Model): # pylint: disable=name-too-long + """AgentPoolUpgradeProfilePropertiesUpgradesItem. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, *, kubernetes_version: Optional[str] = None, is_preview: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class AgentPoolUpgradeSettings(_serialization.Model): + """Settings for upgrading an agentpool. + + :ivar max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. '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 + 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :vartype max_surge: 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 + minutes. + :vartype drain_timeout_in_minutes: int + :ivar node_soak_duration_in_minutes: The amount of time (in minutes) to wait after draining a + 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.v2024_04_02_preview.models.UndrainableNodeBehavior + """ + + _validation = { + "drain_timeout_in_minutes": {"maximum": 1440, "minimum": 1}, + "node_soak_duration_in_minutes": {"maximum": 30, "minimum": 0}, + } + + _attribute_map = { + "max_surge": {"key": "maxSurge", "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, + 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: + """ + :keyword max_surge: This can either be set to an integer (e.g. '5') or a percentage (e.g. + '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 1. For more information, including best practices, see: + https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + :paramtype max_surge: 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 + minutes. + :paramtype drain_timeout_in_minutes: int + :keyword node_soak_duration_in_minutes: The amount of time (in minutes) to wait after draining + 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.v2024_04_02_preview.models.UndrainableNodeBehavior + """ + super().__init__(**kwargs) + self.max_surge = max_surge + 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): + """The Windows agent pool's specific profile. + + :ivar disable_outbound_nat: The default value is false. Outbound NAT can only be disabled if + the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP + enabled. + :vartype disable_outbound_nat: bool + """ + + _attribute_map = { + "disable_outbound_nat": {"key": "disableOutboundNat", "type": "bool"}, + } + + def __init__(self, *, disable_outbound_nat: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword disable_outbound_nat: The default value is false. Outbound NAT can only be disabled if + the cluster outboundType is NAT Gateway and the Windows agent pool does not have node public IP + enabled. + :paramtype disable_outbound_nat: bool + """ + super().__init__(**kwargs) + self.disable_outbound_nat = disable_outbound_nat + + +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 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 + """ + + _attribute_map = { + "sizes": {"key": "sizes", "type": "[str]"}, + "min_count": {"key": "minCount", "type": "int"}, + "max_count": {"key": "maxCount", "type": "int"}, + } + + def __init__( + self, + *, + sizes: Optional[List[str]] = None, + min_count: Optional[int] = None, + max_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 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 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 + """ + super().__init__(**kwargs) + self.sizes = sizes + self.min_count = min_count + self.max_count = max_count + + +class AzureKeyVaultKms(_serialization.Model): + """Azure Key Vault key management service settings for the security profile. + + :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. + :vartype key_id: str + :ivar key_vault_network_access: Network access of key vault. The possible values are ``Public`` + and ``Private``. ``Public`` means the key vault allows public access from all networks. + ``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.v2024_04_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. + :vartype key_vault_resource_id: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "key_id": {"key": "keyId", "type": "str"}, + "key_vault_network_access": {"key": "keyVaultNetworkAccess", "type": "str"}, + "key_vault_resource_id": {"key": "keyVaultResourceId", "type": "str"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + key_id: Optional[str] = None, + key_vault_network_access: Union[str, "_models.KeyVaultNetworkAccessTypes"] = "Public", + key_vault_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable Azure Key Vault key management service. The default is + 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. + :paramtype key_id: str + :keyword key_vault_network_access: Network access of key vault. The possible values are + ``Public`` and ``Private``. ``Public`` means the key vault allows public access from all + 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.v2024_04_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. + :paramtype key_vault_resource_id: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.key_id = key_id + self.key_vault_network_access = key_vault_network_access + self.key_vault_resource_id = key_vault_resource_id + + +class CloudErrorBody(_serialization.Model): + """An error response from the Container service. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: list[~azure.mgmt.containerservice.v2024_04_02_preview.models.CloudErrorBody] + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[CloudErrorBody]"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.CloudErrorBody"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.CloudErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ClusterUpgradeSettings(_serialization.Model): + """Settings for upgrading a cluster. + + :ivar override_settings: Settings for overrides. + :vartype override_settings: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.UpgradeOverrideSettings + """ + + _attribute_map = { + "override_settings": {"key": "overrideSettings", "type": "UpgradeOverrideSettings"}, + } + + def __init__(self, *, override_settings: Optional["_models.UpgradeOverrideSettings"] = None, **kwargs: Any) -> None: + """ + :keyword override_settings: Settings for overrides. + :paramtype override_settings: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.UpgradeOverrideSettings + """ + super().__init__(**kwargs) + self.override_settings = override_settings + + +class CompatibleVersions(_serialization.Model): + """Version information about a product/service that is compatible with a service mesh revision. + + :ivar name: The product/service name. + :vartype name: str + :ivar versions: Product/service versions compatible with a service mesh add-on revision. + :vartype versions: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "versions": {"key": "versions", "type": "[str]"}, + } + + def __init__(self, *, name: Optional[str] = None, versions: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword name: The product/service name. + :paramtype name: str + :keyword versions: Product/service versions compatible with a service mesh add-on revision. + :paramtype versions: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.versions = versions + + +class Component(_serialization.Model): + """Component. + + :ivar name: Component name. + :vartype name: str + :ivar version: Component version. + :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 + :vartype has_breaking_changes: bool + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "has_breaking_changes": {"key": "hasBreakingChanges", "type": "bool"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + version: Optional[str] = None, + has_breaking_changes: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Component name. + :paramtype name: str + :keyword version: Component version. + :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 + :paramtype has_breaking_changes: bool + """ + super().__init__(**kwargs) + self.name = name + self.version = version + self.has_breaking_changes = has_breaking_changes + + +class ComponentsByReleases(_serialization.Model): + """components of given Kubernetes version. + + :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.v2024_04_02_preview.models.Component] + """ + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "components": {"key": "components", "type": "[Component]"}, + } + + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + components: Optional[List["_models.Component"]] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_04_02_preview.models.Component] + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.components = components + + +class ContainerServiceLinuxProfile(_serialization.Model): + """Profile for Linux VMs in the container service cluster. + + All required parameters must be populated in order to send to server. + + :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.v2024_04_02_preview.models.ContainerServiceSshConfiguration + """ + + _validation = { + "admin_username": {"required": True, "pattern": r"^[A-Za-z][-A-Za-z0-9_]*$"}, + "ssh": {"required": True}, + } + + _attribute_map = { + "admin_username": {"key": "adminUsername", "type": "str"}, + "ssh": {"key": "ssh", "type": "ContainerServiceSshConfiguration"}, + } + + def __init__(self, *, admin_username: str, ssh: "_models.ContainerServiceSshConfiguration", **kwargs: Any) -> None: + """ + :keyword admin_username: The administrator username to use for Linux VMs. Required. + :paramtype admin_username: str + :keyword ssh: The SSH configuration for Linux-based VMs running on Azure. Required. + :paramtype ssh: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ContainerServiceSshConfiguration + """ + super().__init__(**kwargs) + self.admin_username = admin_username + self.ssh = ssh + + +class ContainerServiceNetworkProfile(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Profile of network configuration. + + :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.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_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 + not overlap with any Subnet IP ranges. + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :vartype dns_service_ip: str + :ivar outbound_type: This can only be set at cluster creation time and cannot be changed later. + For more information see `egress outbound type + `_. Known values are: "loadBalancer", + "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway", and "none". + :vartype outbound_type: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterLoadBalancerProfile + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + :ivar service_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. They must not overlap with + any Subnet IP ranges. + :vartype service_cidrs: list[str] + :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.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + :ivar monitoring: This addon can be used to configure network monitoring and generate network + monitoring data in Prometheus format. + :vartype monitoring: ~azure.mgmt.containerservice.v2024_04_02_preview.models.NetworkMonitoring + :ivar advanced_networking: Advanced Networking profile for enabling observability on a cluster. + Note that enabling advanced networking features may incur additional costs. For more + information see aka.ms/aksadvancednetworking. + :vartype advanced_networking: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AdvancedNetworking + """ + + _validation = { + "pod_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "service_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + "dns_service_ip": { + "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" + }, + } + + _attribute_map = { + "network_plugin": {"key": "networkPlugin", "type": "str"}, + "network_plugin_mode": {"key": "networkPluginMode", "type": "str"}, + "network_policy": {"key": "networkPolicy", "type": "str"}, + "network_mode": {"key": "networkMode", "type": "str"}, + "network_dataplane": {"key": "networkDataplane", "type": "str"}, + "pod_cidr": {"key": "podCidr", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "outbound_type": {"key": "outboundType", "type": "str"}, + "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, + "load_balancer_profile": {"key": "loadBalancerProfile", "type": "ManagedClusterLoadBalancerProfile"}, + "nat_gateway_profile": {"key": "natGatewayProfile", "type": "ManagedClusterNATGatewayProfile"}, + "static_egress_gateway_profile": { + "key": "staticEgressGatewayProfile", + "type": "ManagedClusterStaticEgressGatewayProfile", + }, + "pod_cidrs": {"key": "podCidrs", "type": "[str]"}, + "service_cidrs": {"key": "serviceCidrs", "type": "[str]"}, + "ip_families": {"key": "ipFamilies", "type": "[str]"}, + "pod_link_local_access": {"key": "podLinkLocalAccess", "type": "str"}, + "kube_proxy_config": {"key": "kubeProxyConfig", "type": "ContainerServiceNetworkProfileKubeProxyConfig"}, + "monitoring": {"key": "monitoring", "type": "NetworkMonitoring"}, + "advanced_networking": {"key": "advancedNetworking", "type": "AdvancedNetworking"}, + } + + def __init__( + self, + *, + network_plugin: Union[str, "_models.NetworkPlugin"] = "kubenet", + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, + network_dataplane: Optional[Union[str, "_models.NetworkDataplane"]] = None, + pod_cidr: str = "10.244.0.0/16", + service_cidr: str = "10.0.0.0/16", + dns_service_ip: str = "10.0.0.10", + outbound_type: Union[str, "_models.OutboundType"] = "loadBalancer", + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, + load_balancer_profile: Optional["_models.ManagedClusterLoadBalancerProfile"] = None, + nat_gateway_profile: Optional["_models.ManagedClusterNATGatewayProfile"] = None, + static_egress_gateway_profile: Optional["_models.ManagedClusterStaticEgressGatewayProfile"] = None, + pod_cidrs: Optional[List[str]] = None, + service_cidrs: Optional[List[str]] = None, + ip_families: Optional[List[Union[str, "_models.IpFamily"]]] = None, + pod_link_local_access: Optional[Union[str, "_models.PodLinkLocalAccess"]] = None, + kube_proxy_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfig"] = None, + monitoring: Optional["_models.NetworkMonitoring"] = None, + advanced_networking: Optional["_models.AdvancedNetworking"] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_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 + must not overlap with any Subnet IP ranges. + :paramtype service_cidr: str + :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be + within the Kubernetes service address range specified in serviceCidr. + :paramtype dns_service_ip: str + :keyword outbound_type: This can only be set at cluster creation time and cannot be changed + 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.v2024_04_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.v2024_04_02_preview.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + :keyword service_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. They must not overlap + with any Subnet IP ranges. + :paramtype service_cidrs: list[str] + :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.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + :keyword monitoring: This addon can be used to configure network monitoring and generate + network monitoring data in Prometheus format. + :paramtype monitoring: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.NetworkMonitoring + :keyword advanced_networking: Advanced Networking profile for enabling observability on a + cluster. Note that enabling advanced networking features may incur additional costs. For more + information see aka.ms/aksadvancednetworking. + :paramtype advanced_networking: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AdvancedNetworking + """ + super().__init__(**kwargs) + self.network_plugin = network_plugin + self.network_plugin_mode = network_plugin_mode + self.network_policy = network_policy + self.network_mode = network_mode + self.network_dataplane = network_dataplane + self.pod_cidr = pod_cidr + self.service_cidr = service_cidr + self.dns_service_ip = dns_service_ip + self.outbound_type = outbound_type + self.load_balancer_sku = load_balancer_sku + self.load_balancer_profile = load_balancer_profile + self.nat_gateway_profile = nat_gateway_profile + self.static_egress_gateway_profile = static_egress_gateway_profile + self.pod_cidrs = pod_cidrs + self.service_cidrs = service_cidrs + self.ip_families = ip_families + self.pod_link_local_access = pod_link_local_access + self.kube_proxy_config = kube_proxy_config + self.monitoring = monitoring + self.advanced_networking = advanced_networking + + +class ContainerServiceNetworkProfileKubeProxyConfig(_serialization.Model): # pylint: disable=name-too-long + """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'. + + :ivar enabled: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, + kube-proxy is enabled in AKS by default without these customizations). + :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.v2024_04_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.v2024_04_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "mode": {"key": "mode", "type": "str"}, + "ipvs_config": {"key": "ipvsConfig", "type": "ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + mode: Optional[Union[str, "_models.Mode"]] = None, + ipvs_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' + exists, kube-proxy is enabled in AKS by default without these customizations). + :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.v2024_04_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.v2024_04_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + """ + super().__init__(**kwargs) + self.enabled = enabled + self.mode = mode + self.ipvs_config = ipvs_config + + +class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(_serialization.Model): # pylint: disable=name-too-long + """Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + + :ivar scheduler: IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and + "LeastConnection". + :vartype scheduler: str or + ~azure.mgmt.containerservice.v2024_04_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 + :ivar tcp_fin_timeout_seconds: The timeout value used for IPVS TCP sessions after receiving a + FIN in seconds. Must be a positive integer value. + :vartype tcp_fin_timeout_seconds: int + :ivar udp_timeout_seconds: The timeout value used for IPVS UDP packets in seconds. Must be a + positive integer value. + :vartype udp_timeout_seconds: int + """ + + _attribute_map = { + "scheduler": {"key": "scheduler", "type": "str"}, + "tcp_timeout_seconds": {"key": "tcpTimeoutSeconds", "type": "int"}, + "tcp_fin_timeout_seconds": {"key": "tcpFinTimeoutSeconds", "type": "int"}, + "udp_timeout_seconds": {"key": "udpTimeoutSeconds", "type": "int"}, + } + + def __init__( + self, + *, + scheduler: Optional[Union[str, "_models.IpvsScheduler"]] = None, + tcp_timeout_seconds: Optional[int] = None, + tcp_fin_timeout_seconds: Optional[int] = None, + udp_timeout_seconds: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword scheduler: IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and + "LeastConnection". + :paramtype scheduler: str or + ~azure.mgmt.containerservice.v2024_04_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 + :keyword tcp_fin_timeout_seconds: The timeout value used for IPVS TCP sessions after receiving + a FIN in seconds. Must be a positive integer value. + :paramtype tcp_fin_timeout_seconds: int + :keyword udp_timeout_seconds: The timeout value used for IPVS UDP packets in seconds. Must be a + positive integer value. + :paramtype udp_timeout_seconds: int + """ + super().__init__(**kwargs) + self.scheduler = scheduler + self.tcp_timeout_seconds = tcp_timeout_seconds + self.tcp_fin_timeout_seconds = tcp_fin_timeout_seconds + self.udp_timeout_seconds = udp_timeout_seconds + + +class ContainerServiceSshConfiguration(_serialization.Model): + """SSH configuration for Linux-based VMs running on Azure. + + All required parameters must be populated in order to send to server. + + :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.v2024_04_02_preview.models.ContainerServiceSshPublicKey] + """ + + _validation = { + "public_keys": {"required": True}, + } + + _attribute_map = { + "public_keys": {"key": "publicKeys", "type": "[ContainerServiceSshPublicKey]"}, + } + + def __init__(self, *, public_keys: List["_models.ContainerServiceSshPublicKey"], **kwargs: Any) -> None: + """ + :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.v2024_04_02_preview.models.ContainerServiceSshPublicKey] + """ + super().__init__(**kwargs) + self.public_keys = public_keys + + +class ContainerServiceSshPublicKey(_serialization.Model): + """Contains information about SSH certificate public key data. + + All required parameters must be populated in order to send to server. + + :ivar key_data: Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. Required. + :vartype key_data: str + """ + + _validation = { + "key_data": {"required": True}, + } + + _attribute_map = { + "key_data": {"key": "keyData", "type": "str"}, + } + + def __init__(self, *, key_data: str, **kwargs: Any) -> None: + """ + :keyword key_data: Certificate public key used to authenticate with VMs through SSH. The + certificate must be in PEM format with or without headers. Required. + :paramtype key_data: str + """ + super().__init__(**kwargs) + self.key_data = key_data + + +class CreationData(_serialization.Model): + """Data used when creating a target resource from a source resource. + + :ivar source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :vartype source_resource_id: str + """ + + _attribute_map = { + "source_resource_id": {"key": "sourceResourceId", "type": "str"}, + } + + def __init__(self, *, source_resource_id: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword source_resource_id: This is the ARM ID of the source object to be used to create the + target object. + :paramtype source_resource_id: str + """ + super().__init__(**kwargs) + self.source_resource_id = source_resource_id + + +class CredentialResult(_serialization.Model): + """The credential result response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytes + """ + + _validation = { + "name": {"readonly": True}, + "value": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "bytearray"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.name = None + self.value = None + + +class CredentialResults(_serialization.Model): + """The list credential result response. + + 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.v2024_04_02_preview.models.CredentialResult] + """ + + _validation = { + "kubeconfigs": {"readonly": True}, + } + + _attribute_map = { + "kubeconfigs": {"key": "kubeconfigs", "type": "[CredentialResult]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.kubeconfigs = None + + +class DailySchedule(_serialization.Model): + """For schedules like: 'recur every day' or 'recur every 3 days'. + + All required parameters must be populated in order to send to server. + + :ivar interval_days: Specifies the number of days between each set of occurrences. Required. + :vartype interval_days: int + """ + + _validation = { + "interval_days": {"required": True, "maximum": 7, "minimum": 1}, + } + + _attribute_map = { + "interval_days": {"key": "intervalDays", "type": "int"}, + } + + def __init__(self, *, interval_days: int, **kwargs: Any) -> None: + """ + :keyword interval_days: Specifies the number of days between each set of occurrences. Required. + :paramtype interval_days: int + """ + super().__init__(**kwargs) + self.interval_days = interval_days + + +class DateSpan(_serialization.Model): + """For example, between '2022-12-23' and '2023-01-05'. + + All required parameters must be populated in order to send to server. + + :ivar start: The start date of the date span. Required. + :vartype start: ~datetime.date + :ivar end: The end date of the date span. Required. + :vartype end: ~datetime.date + """ + + _validation = { + "start": {"required": True}, + "end": {"required": True}, + } + + _attribute_map = { + "start": {"key": "start", "type": "date"}, + "end": {"key": "end", "type": "date"}, + } + + def __init__(self, *, start: datetime.date, end: datetime.date, **kwargs: Any) -> None: + """ + :keyword start: The start date of the date span. Required. + :paramtype start: ~datetime.date + :keyword end: The end date of the date span. Required. + :paramtype end: ~datetime.date + """ + super().__init__(**kwargs) + self.start = start + self.end = end + + +class DelegatedResource(_serialization.Model): + """Delegated resource properties - internal use only. + + :ivar resource_id: The ARM resource id of the delegated resource - internal use only. + :vartype resource_id: str + :ivar tenant_id: The tenant id of the delegated resource - internal use only. + :vartype tenant_id: str + :ivar referral_resource: The delegation id of the referral delegation (optional) - internal use + only. + :vartype referral_resource: str + :ivar location: The source resource location - internal use only. + :vartype location: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "referral_resource": {"key": "referralResource", "type": "str"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + tenant_id: Optional[str] = None, + referral_resource: Optional[str] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The ARM resource id of the delegated resource - internal use only. + :paramtype resource_id: str + :keyword tenant_id: The tenant id of the delegated resource - internal use only. + :paramtype tenant_id: str + :keyword referral_resource: The delegation id of the referral delegation (optional) - internal + use only. + :paramtype referral_resource: str + :keyword location: The source resource location - internal use only. + :paramtype location: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.tenant_id = tenant_id + self.referral_resource = referral_resource + self.location = location + + +class EndpointDependency(_serialization.Model): + """A domain name that AKS agent nodes are reaching at. + + :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.v2024_04_02_preview.models.EndpointDetail] + """ + + _attribute_map = { + "domain_name": {"key": "domainName", "type": "str"}, + "endpoint_details": {"key": "endpointDetails", "type": "[EndpointDetail]"}, + } + + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[List["_models.EndpointDetail"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword domain_name: The domain name of the dependency. + :paramtype domain_name: str + :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. + :paramtype endpoint_details: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.EndpointDetail] + """ + super().__init__(**kwargs) + self.domain_name = domain_name + self.endpoint_details = endpoint_details + + +class EndpointDetail(_serialization.Model): + """connect information from the AKS agent nodes to a single endpoint. + + :ivar ip_address: An IP Address that Domain Name currently resolves to. + :vartype ip_address: str + :ivar port: The port an endpoint is connected to. + :vartype port: int + :ivar protocol: The protocol used for connection. + :vartype protocol: str + :ivar description: Description of the detail. + :vartype description: str + """ + + _attribute_map = { + "ip_address": {"key": "ipAddress", "type": "str"}, + "port": {"key": "port", "type": "int"}, + "protocol": {"key": "protocol", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword ip_address: An IP Address that Domain Name currently resolves to. + :paramtype ip_address: str + :keyword port: The port an endpoint is connected to. + :paramtype port: int + :keyword protocol: The protocol used for connection. + :paramtype protocol: str + :keyword description: Description of the detail. + :paramtype description: str + """ + super().__init__(**kwargs) + self.ip_address = ip_address + self.port = port + self.protocol = protocol + self.description = description + + +class ErrorAdditionalInfo(_serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: JSON + """ + + _validation = { + "type": {"readonly": True}, + "info": {"readonly": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(_serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ErrorAdditionalInfo] + """ + + _validation = { + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, + } + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, + } + + 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 + + +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ErrorDetail + """ + + _attribute_map = { + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: + """ + :keyword error: The error object. + :paramtype error: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ErrorDetail + """ + super().__init__(**kwargs) + self.error = error + + +class ExtendedLocation(_serialization.Model): + """The complex type of the extended location. + + :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.v2024_04_02_preview.models.ExtendedLocationTypes + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_04_02_preview.models.ExtendedLocationTypes + """ + super().__init__(**kwargs) + self.name = name + self.type = type + + +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SystemData + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class GuardrailsAvailableVersion(Resource): + """Available Guardrails Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SystemData + :ivar properties: Whether the version is default or not and support info. Required. + :vartype properties: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.GuardrailsAvailableVersionsProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "GuardrailsAvailableVersionsProperties"}, + } + + def __init__(self, *, properties: "_models.GuardrailsAvailableVersionsProperties", **kwargs: Any) -> None: + """ + :keyword properties: Whether the version is default or not and support info. Required. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.GuardrailsAvailableVersionsProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class GuardrailsAvailableVersionsList(_serialization.Model): + """Hold values properties, which is array of GuardrailsVersions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of AKS supported Guardrails versions. + :vartype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.GuardrailsAvailableVersion] + :ivar next_link: The URL to get the next Guardrails available version. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[GuardrailsAvailableVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.GuardrailsAvailableVersion"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Array of AKS supported Guardrails versions. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.GuardrailsAvailableVersion] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class GuardrailsAvailableVersionsProperties(_serialization.Model): + """Whether the version is default or not and support info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_default_version: + :vartype is_default_version: bool + :ivar support: Whether the version is preview or stable. Known values are: "Preview" and + "Stable". + :vartype support: str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.GuardrailsSupport + """ + + _validation = { + "is_default_version": {"readonly": True}, + "support": {"readonly": True}, + } + + _attribute_map = { + "is_default_version": {"key": "isDefaultVersion", "type": "bool"}, + "support": {"key": "support", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.is_default_version = None + self.support = None + + +class IPTag(_serialization.Model): + """Contains the IPTag associated with the object. + + :ivar ip_tag_type: The IP tag type. Example: RoutingPreference. + :vartype ip_tag_type: str + :ivar tag: The value of the IP tag associated with the public IP. Example: Internet. + :vartype tag: str + """ + + _attribute_map = { + "ip_tag_type": {"key": "ipTagType", "type": "str"}, + "tag": {"key": "tag", "type": "str"}, + } + + def __init__(self, *, ip_tag_type: Optional[str] = None, tag: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword ip_tag_type: The IP tag type. Example: RoutingPreference. + :paramtype ip_tag_type: str + :keyword tag: The value of the IP tag associated with the public IP. Example: Internet. + :paramtype tag: str + """ + super().__init__(**kwargs) + self.ip_tag_type = ip_tag_type + self.tag = tag + + +class IstioCertificateAuthority(_serialization.Model): + """Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin + certificates as described here https://aka.ms/asm-plugin-ca. + + :ivar plugin: Plugin certificates information for Service Mesh. + :vartype plugin: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioPluginCertificateAuthority + """ + + _attribute_map = { + "plugin": {"key": "plugin", "type": "IstioPluginCertificateAuthority"}, + } + + def __init__(self, *, plugin: Optional["_models.IstioPluginCertificateAuthority"] = None, **kwargs: Any) -> None: + """ + :keyword plugin: Plugin certificates information for Service Mesh. + :paramtype plugin: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioPluginCertificateAuthority + """ + super().__init__(**kwargs) + self.plugin = plugin + + +class IstioComponents(_serialization.Model): + """Istio components configuration. + + :ivar ingress_gateways: Istio ingress gateways. + :vartype ingress_gateways: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioIngressGateway] + :ivar egress_gateways: Istio egress gateways. + :vartype egress_gateways: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioEgressGateway] + """ + + _attribute_map = { + "ingress_gateways": {"key": "ingressGateways", "type": "[IstioIngressGateway]"}, + "egress_gateways": {"key": "egressGateways", "type": "[IstioEgressGateway]"}, + } + + def __init__( + self, + *, + ingress_gateways: Optional[List["_models.IstioIngressGateway"]] = None, + egress_gateways: Optional[List["_models.IstioEgressGateway"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword ingress_gateways: Istio ingress gateways. + :paramtype ingress_gateways: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioIngressGateway] + :keyword egress_gateways: Istio egress gateways. + :paramtype egress_gateways: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioEgressGateway] + """ + super().__init__(**kwargs) + self.ingress_gateways = ingress_gateways + self.egress_gateways = egress_gateways + + +class IstioEgressGateway(_serialization.Model): + """Istio egress gateway configuration. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable the egress gateway. Required. + :vartype enabled: bool + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: bool, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable the egress gateway. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class IstioIngressGateway(_serialization.Model): + """Istio ingress gateway configuration. For now, we support up to one external ingress gateway + named ``aks-istio-ingressgateway-external`` and one internal ingress gateway named + ``aks-istio-ingressgateway-internal``. + + 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.v2024_04_02_preview.models.IstioIngressGatewayMode + :ivar enabled: Whether to enable the ingress gateway. Required. + :vartype enabled: bool + """ + + _validation = { + "mode": {"required": True}, + "enabled": {"required": True}, + } + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, mode: Union[str, "_models.IstioIngressGatewayMode"], enabled: bool, **kwargs: Any) -> None: + """ + :keyword mode: Mode of an ingress gateway. Required. Known values are: "External" and + "Internal". + :paramtype mode: str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioIngressGatewayMode + :keyword enabled: Whether to enable the ingress gateway. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.mode = mode + self.enabled = enabled + + +class IstioPluginCertificateAuthority(_serialization.Model): + """Plugin certificates information for Service Mesh. + + :ivar key_vault_id: The resource ID of the Key Vault. + :vartype key_vault_id: str + :ivar cert_object_name: Intermediate certificate object name in Azure Key Vault. + :vartype cert_object_name: str + :ivar key_object_name: Intermediate certificate private key object name in Azure Key Vault. + :vartype key_object_name: str + :ivar root_cert_object_name: Root certificate object name in Azure Key Vault. + :vartype root_cert_object_name: str + :ivar cert_chain_object_name: Certificate chain object name in Azure Key Vault. + :vartype cert_chain_object_name: str + """ + + _attribute_map = { + "key_vault_id": {"key": "keyVaultId", "type": "str"}, + "cert_object_name": {"key": "certObjectName", "type": "str"}, + "key_object_name": {"key": "keyObjectName", "type": "str"}, + "root_cert_object_name": {"key": "rootCertObjectName", "type": "str"}, + "cert_chain_object_name": {"key": "certChainObjectName", "type": "str"}, + } + + def __init__( + self, + *, + key_vault_id: Optional[str] = None, + cert_object_name: Optional[str] = None, + key_object_name: Optional[str] = None, + root_cert_object_name: Optional[str] = None, + cert_chain_object_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword key_vault_id: The resource ID of the Key Vault. + :paramtype key_vault_id: str + :keyword cert_object_name: Intermediate certificate object name in Azure Key Vault. + :paramtype cert_object_name: str + :keyword key_object_name: Intermediate certificate private key object name in Azure Key Vault. + :paramtype key_object_name: str + :keyword root_cert_object_name: Root certificate object name in Azure Key Vault. + :paramtype root_cert_object_name: str + :keyword cert_chain_object_name: Certificate chain object name in Azure Key Vault. + :paramtype cert_chain_object_name: str + """ + super().__init__(**kwargs) + self.key_vault_id = key_vault_id + self.cert_object_name = cert_object_name + self.key_object_name = key_object_name + self.root_cert_object_name = root_cert_object_name + self.cert_chain_object_name = cert_chain_object_name + + +class IstioServiceMesh(_serialization.Model): + """Istio service mesh configuration. + + :ivar components: Istio components configuration. + :vartype components: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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: + https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. + :vartype revisions: list[str] + """ + + _validation = { + "revisions": {"max_items": 2, "min_items": 0, "unique": True}, + } + + _attribute_map = { + "components": {"key": "components", "type": "IstioComponents"}, + "certificate_authority": {"key": "certificateAuthority", "type": "IstioCertificateAuthority"}, + "revisions": {"key": "revisions", "type": "[str]"}, + } + + def __init__( + self, + *, + components: Optional["_models.IstioComponents"] = None, + certificate_authority: Optional["_models.IstioCertificateAuthority"] = None, + revisions: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword components: Istio components configuration. + :paramtype components: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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: + https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. + :paramtype revisions: list[str] + """ + super().__init__(**kwargs) + self.components = components + self.certificate_authority = certificate_authority + self.revisions = revisions + + +class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes + """See `AKS custom node configuration + `_ for more details. + + :ivar cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :vartype cpu_manager_policy: str + :ivar cpu_cfs_quota: The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :vartype cpu_cfs_quota_period: str + :ivar image_gc_high_threshold: To disable image garbage collection, set to 100. The default is + 85%. + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The default + is 80%. + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :vartype topology_manager_policy: str + :ivar allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending + in ``*``\\ ). + :vartype allowed_unsafe_sysctls: list[str] + :ivar fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled on + the node. + :vartype fail_swap_on: bool + :ivar container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before it + is rotated. + :vartype container_log_max_size_mb: int + :ivar container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :vartype container_log_max_files: int + :ivar pod_max_pids: The maximum number of processes per pod. + :vartype pod_max_pids: int + """ + + _validation = { + "container_log_max_files": {"minimum": 2}, + } + + _attribute_map = { + "cpu_manager_policy": {"key": "cpuManagerPolicy", "type": "str"}, + "cpu_cfs_quota": {"key": "cpuCfsQuota", "type": "bool"}, + "cpu_cfs_quota_period": {"key": "cpuCfsQuotaPeriod", "type": "str"}, + "image_gc_high_threshold": {"key": "imageGcHighThreshold", "type": "int"}, + "image_gc_low_threshold": {"key": "imageGcLowThreshold", "type": "int"}, + "topology_manager_policy": {"key": "topologyManagerPolicy", "type": "str"}, + "allowed_unsafe_sysctls": {"key": "allowedUnsafeSysctls", "type": "[str]"}, + "fail_swap_on": {"key": "failSwapOn", "type": "bool"}, + "container_log_max_size_mb": {"key": "containerLogMaxSizeMB", "type": "int"}, + "container_log_max_files": {"key": "containerLogMaxFiles", "type": "int"}, + "pod_max_pids": {"key": "podMaxPids", "type": "int"}, + } + + def __init__( + self, + *, + cpu_manager_policy: Optional[str] = None, + cpu_cfs_quota: Optional[bool] = None, + cpu_cfs_quota_period: Optional[str] = None, + image_gc_high_threshold: Optional[int] = None, + image_gc_low_threshold: Optional[int] = None, + topology_manager_policy: Optional[str] = None, + allowed_unsafe_sysctls: Optional[List[str]] = None, + fail_swap_on: Optional[bool] = None, + container_log_max_size_mb: Optional[int] = None, + container_log_max_files: Optional[int] = None, + pod_max_pids: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword cpu_manager_policy: The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'. + :paramtype cpu_manager_policy: str + :keyword cpu_cfs_quota: The default is true. + :paramtype cpu_cfs_quota: bool + :keyword cpu_cfs_quota_period: The default is '100ms.' Valid values are a sequence of decimal + numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + :paramtype cpu_cfs_quota_period: str + :keyword image_gc_high_threshold: To disable image garbage collection, set to 100. The default + is 85%. + :paramtype image_gc_high_threshold: int + :keyword image_gc_low_threshold: This cannot be set higher than imageGcHighThreshold. The + default is 80%. + :paramtype image_gc_low_threshold: int + :keyword topology_manager_policy: For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + :paramtype topology_manager_policy: str + :keyword allowed_unsafe_sysctls: Allowed list of unsafe sysctls or unsafe sysctl patterns + (ending in ``*``\\ ). + :paramtype allowed_unsafe_sysctls: list[str] + :keyword fail_swap_on: If set to true it will make the Kubelet fail to start if swap is enabled + on the node. + :paramtype fail_swap_on: bool + :keyword container_log_max_size_mb: The maximum size (e.g. 10Mi) of container log file before + it is rotated. + :paramtype container_log_max_size_mb: int + :keyword container_log_max_files: The maximum number of container log files that can be present + for a container. The number must be ≥ 2. + :paramtype container_log_max_files: int + :keyword pod_max_pids: The maximum number of processes per pod. + :paramtype pod_max_pids: int + """ + super().__init__(**kwargs) + self.cpu_manager_policy = cpu_manager_policy + self.cpu_cfs_quota = cpu_cfs_quota + self.cpu_cfs_quota_period = cpu_cfs_quota_period + self.image_gc_high_threshold = image_gc_high_threshold + self.image_gc_low_threshold = image_gc_low_threshold + self.topology_manager_policy = topology_manager_policy + self.allowed_unsafe_sysctls = allowed_unsafe_sysctls + self.fail_swap_on = fail_swap_on + self.container_log_max_size_mb = container_log_max_size_mb + self.container_log_max_files = container_log_max_files + self.pod_max_pids = pod_max_pids + + +class KubernetesPatchVersion(_serialization.Model): + """Kubernetes patch version profile. + + :ivar upgrades: Possible upgrade path for given patch version. + :vartype upgrades: list[str] + """ + + _attribute_map = { + "upgrades": {"key": "upgrades", "type": "[str]"}, + } + + def __init__(self, *, upgrades: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword upgrades: Possible upgrade path for given patch version. + :paramtype upgrades: list[str] + """ + super().__init__(**kwargs) + self.upgrades = upgrades + + +class KubernetesVersion(_serialization.Model): + """Kubernetes version profile for given major.minor release. + + :ivar version: major.minor version of Kubernetes release. + :vartype version: str + :ivar capabilities: Capabilities on this Kubernetes version. + :vartype capabilities: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.KubernetesPatchVersion] + """ + + _attribute_map = { + "version": {"key": "version", "type": "str"}, + "capabilities": {"key": "capabilities", "type": "KubernetesVersionCapabilities"}, + "is_default": {"key": "isDefault", "type": "bool"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + "patch_versions": {"key": "patchVersions", "type": "{KubernetesPatchVersion}"}, + } + + def __init__( + self, + *, + version: Optional[str] = None, + capabilities: Optional["_models.KubernetesVersionCapabilities"] = None, + is_default: Optional[bool] = None, + is_preview: Optional[bool] = None, + patch_versions: Optional[Dict[str, "_models.KubernetesPatchVersion"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: major.minor version of Kubernetes release. + :paramtype version: str + :keyword capabilities: Capabilities on this Kubernetes version. + :paramtype capabilities: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.KubernetesPatchVersion] + """ + super().__init__(**kwargs) + self.version = version + self.capabilities = capabilities + self.is_default = is_default + self.is_preview = is_preview + self.patch_versions = patch_versions + + +class KubernetesVersionCapabilities(_serialization.Model): + """Capabilities on this Kubernetes version. + + :ivar support_plan: + :vartype support_plan: list[str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.KubernetesSupportPlan] + """ + + _attribute_map = { + "support_plan": {"key": "supportPlan", "type": "[str]"}, + } + + def __init__( + self, *, support_plan: Optional[List[Union[str, "_models.KubernetesSupportPlan"]]] = None, **kwargs: Any + ) -> None: + """ + :keyword support_plan: + :paramtype support_plan: list[str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.KubernetesSupportPlan] + """ + super().__init__(**kwargs) + self.support_plan = support_plan + + +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.v2024_04_02_preview.models.KubernetesVersion] + """ + + _attribute_map = { + "values": {"key": "values", "type": "[KubernetesVersion]"}, + } + + 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.v2024_04_02_preview.models.KubernetesVersion] + """ + super().__init__(**kwargs) + self.values = values + + +class LabelSelector(_serialization.Model): + """A label selector is a label query over a set of resources. The result of matchLabels and + matchExpressions are ANDed. An empty label selector matches all objects. A null label selector + matches no objects. + + :ivar match_labels: matchLabels is an array of {key=value} pairs. A single {key=value} in the + matchLabels map is equivalent to an element of matchExpressions, whose key field is ``key``\\ , + the operator is ``In``\\ , and the values array contains only ``value``. The requirements are + ANDed. + :vartype match_labels: list[str] + :ivar match_expressions: matchExpressions is a list of label selector requirements. The + requirements are ANDed. + :vartype match_expressions: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.LabelSelectorRequirement] + """ + + _attribute_map = { + "match_labels": {"key": "matchLabels", "type": "[str]"}, + "match_expressions": {"key": "matchExpressions", "type": "[LabelSelectorRequirement]"}, + } + + def __init__( + self, + *, + match_labels: Optional[List[str]] = None, + match_expressions: Optional[List["_models.LabelSelectorRequirement"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword match_labels: matchLabels is an array of {key=value} pairs. A single {key=value} in + the matchLabels map is equivalent to an element of matchExpressions, whose key field is + ``key``\\ , the operator is ``In``\\ , and the values array contains only ``value``. The + requirements are ANDed. + :paramtype match_labels: list[str] + :keyword match_expressions: matchExpressions is a list of label selector requirements. The + requirements are ANDed. + :paramtype match_expressions: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.LabelSelectorRequirement] + """ + super().__init__(**kwargs) + self.match_labels = match_labels + self.match_expressions = match_expressions + + +class LabelSelectorRequirement(_serialization.Model): + """A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + + :ivar key: key is the label key that the selector applies to. + :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", and "DoesNotExist". + :vartype operator: str or ~azure.mgmt.containerservice.v2024_04_02_preview.models.Operator + :ivar values: values is an array of string values, the values array must be non-empty. + :vartype values: list[str] + """ + + _attribute_map = { + "key": {"key": "key", "type": "str"}, + "operator": {"key": "operator", "type": "str"}, + "values": {"key": "values", "type": "[str]"}, + } + + def __init__( + self, + *, + key: Optional[str] = None, + operator: Optional[Union[str, "_models.Operator"]] = None, + values: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword key: key is the label key that the selector applies to. + :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", and "DoesNotExist". + :paramtype operator: str or ~azure.mgmt.containerservice.v2024_04_02_preview.models.Operator + :keyword values: values is an array of string values, the values array must be non-empty. + :paramtype values: list[str] + """ + super().__init__(**kwargs) + self.key = key + self.operator = operator + self.values = values + + +class LinuxOSConfig(_serialization.Model): + """See `AKS custom node configuration + `_ for more details. + + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2024_04_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 + `_. + :vartype transparent_huge_page_enabled: str + :ivar transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :vartype transparent_huge_page_defrag: str + :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :vartype swap_file_size_mb: int + """ + + _attribute_map = { + "sysctls": {"key": "sysctls", "type": "SysctlConfig"}, + "transparent_huge_page_enabled": {"key": "transparentHugePageEnabled", "type": "str"}, + "transparent_huge_page_defrag": {"key": "transparentHugePageDefrag", "type": "str"}, + "swap_file_size_mb": {"key": "swapFileSizeMB", "type": "int"}, + } + + def __init__( + self, + *, + sysctls: Optional["_models.SysctlConfig"] = None, + transparent_huge_page_enabled: Optional[str] = None, + transparent_huge_page_defrag: Optional[str] = None, + swap_file_size_mb: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2024_04_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 + `_. + :paramtype transparent_huge_page_enabled: str + :keyword transparent_huge_page_defrag: Valid values are 'always', 'defer', 'defer+madvise', + 'madvise' and 'never'. The default is 'madvise'. For more information see `Transparent + Hugepages + `_. + :paramtype transparent_huge_page_defrag: str + :keyword swap_file_size_mb: The size in MB of a swap file that will be created on each node. + :paramtype swap_file_size_mb: int + """ + super().__init__(**kwargs) + self.sysctls = sysctls + self.transparent_huge_page_enabled = transparent_huge_page_enabled + self.transparent_huge_page_defrag = transparent_huge_page_defrag + self.swap_file_size_mb = swap_file_size_mb + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SystemData + """ + + +class LoadBalancer(ProxyResource): # pylint: disable=too-many-instance-attributes + """The configurations regarding multiple standard load balancers. If not supplied, single load + balancer mode will be used. Multiple standard load balancers mode will be used if at lease one + configuration is supplied. There has to be a configuration named ``kubernetes``. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SystemData + :ivar name_properties_name: Name of the public load balancer. There will be an internal load + balancer created if needed, and the name will be ``-internal``. The internal lb shares + the same configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. There must be a name of kubernetes in the list. + :vartype name_properties_name: str + :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 + agent pool can only be the primary pool for a single load balancer. + :vartype primary_agent_pool_name: str + :ivar allow_service_placement: Whether to automatically place services on the load balancer. If + not supplied, the default value is true. If set to false manually, both of the external and the + internal load balancer will not be selected for services unless they explicitly target it. + :vartype allow_service_placement: bool + :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.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.LabelSelector + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "name_properties_name": {"key": "properties.name", "type": "str"}, + "primary_agent_pool_name": {"key": "properties.primaryAgentPoolName", "type": "str"}, + "allow_service_placement": {"key": "properties.allowServicePlacement", "type": "bool"}, + "service_label_selector": {"key": "properties.serviceLabelSelector", "type": "LabelSelector"}, + "service_namespace_selector": {"key": "properties.serviceNamespaceSelector", "type": "LabelSelector"}, + "node_selector": {"key": "properties.nodeSelector", "type": "LabelSelector"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__( + self, + *, + name_properties_name: Optional[str] = None, + primary_agent_pool_name: Optional[str] = None, + allow_service_placement: Optional[bool] = None, + service_label_selector: Optional["_models.LabelSelector"] = None, + service_namespace_selector: Optional["_models.LabelSelector"] = None, + node_selector: Optional["_models.LabelSelector"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name_properties_name: Name of the public load balancer. There will be an internal load + balancer created if needed, and the name will be ``-internal``. The internal lb shares + the same configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. There must be a name of kubernetes in the list. + :paramtype name_properties_name: str + :keyword 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 + agent pool can only be the primary pool for a single load balancer. + :paramtype primary_agent_pool_name: str + :keyword allow_service_placement: Whether to automatically place services on the load balancer. + If not supplied, the default value is true. If set to false manually, both of the external and + the internal load balancer will not be selected for services unless they explicitly target it. + :paramtype allow_service_placement: bool + :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.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.LabelSelector + """ + super().__init__(**kwargs) + self.name_properties_name = name_properties_name + self.primary_agent_pool_name = primary_agent_pool_name + self.allow_service_placement = allow_service_placement + self.service_label_selector = service_label_selector + self.service_namespace_selector = service_namespace_selector + self.node_selector = node_selector + self.provisioning_state = None + + +class LoadBalancerListResult(_serialization.Model): + """The response from the List Load Balancers operation. + + 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.v2024_04_02_preview.models.LoadBalancer] + :ivar next_link: The URL to get the next set of load balancer results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[LoadBalancer]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_04_02_preview.models.LoadBalancer] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class Machine(SubResource): + """A machine. Contains details about the underlying virtual machine. A machine may be visible here + but not in kubectl get nodes; if so it may be because the machine has not been registered with + the Kubernetes API Server yet. + + 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 properties: The properties of the machine. + :vartype properties: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MachineProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "properties": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "properties": {"key": "properties", "type": "MachineProperties"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.properties = None + + +class MachineIpAddress(_serialization.Model): + """The machine IP address details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar ip: IPv4 or IPv6 address of the machine. + :vartype ip: str + :ivar family: To determine if address belongs IPv4 or IPv6 family. Known values are: "IPv4" and + "IPv6". + :vartype family: str or ~azure.mgmt.containerservice.v2024_04_02_preview.models.IpFamily + """ + + _validation = { + "ip": {"readonly": True}, + "family": {"readonly": True}, + } + + _attribute_map = { + "ip": {"key": "ip", "type": "str"}, + "family": {"key": "family", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.ip = None + self.family = None + + +class MachineListResult(_serialization.Model): + """The response from the List Machines operation. + + 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.v2024_04_02_preview.models.Machine] + :ivar next_link: The URL to get the next set of machine results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Machine]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_04_02_preview.models.Machine] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MachineNetworkProperties(_serialization.Model): + """network properties of the machine. + + 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.v2024_04_02_preview.models.MachineIpAddress] + """ + + _validation = { + "ip_addresses": {"readonly": True}, + } + + _attribute_map = { + "ip_addresses": {"key": "ipAddresses", "type": "[MachineIpAddress]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.ip_addresses = None + + +class MachineProperties(_serialization.Model): + """The properties of the machine. + + 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.v2024_04_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 + """ + + _validation = { + "network": {"readonly": True}, + "resource_id": {"readonly": True}, + } + + _attribute_map = { + "network": {"key": "network", "type": "MachineNetworkProperties"}, + "resource_id": {"key": "resourceId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.network = None + self.resource_id = None + + +class MaintenanceConfiguration(SubResource): + """See `planned maintenance `_ for more + information about planned maintenance. + + 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.v2024_04_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.v2024_04_02_preview.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.TimeSpan] + :ivar maintenance_window: Maintenance window for the maintenance configuration. + :vartype maintenance_window: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.MaintenanceWindow + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "time_in_week": {"key": "properties.timeInWeek", "type": "[TimeInWeek]"}, + "not_allowed_time": {"key": "properties.notAllowedTime", "type": "[TimeSpan]"}, + "maintenance_window": {"key": "properties.maintenanceWindow", "type": "MaintenanceWindow"}, + } + + def __init__( + self, + *, + time_in_week: Optional[List["_models.TimeInWeek"]] = None, + not_allowed_time: Optional[List["_models.TimeSpan"]] = None, + maintenance_window: Optional["_models.MaintenanceWindow"] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_04_02_preview.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.TimeSpan] + :keyword maintenance_window: Maintenance window for the maintenance configuration. + :paramtype maintenance_window: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.MaintenanceWindow + """ + super().__init__(**kwargs) + self.system_data = None + self.time_in_week = time_in_week + self.not_allowed_time = not_allowed_time + self.maintenance_window = maintenance_window + + +class MaintenanceConfigurationListResult(_serialization.Model): + """The response from the List maintenance configurations operation. + + 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.v2024_04_02_preview.models.MaintenanceConfiguration] + :ivar next_link: The URL to get the next set of maintenance configuration results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MaintenanceConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.MaintenanceConfiguration"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.MaintenanceConfiguration] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MaintenanceWindow(_serialization.Model): + """Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + + 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.v2024_04_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' + for PST. If not specified, the default is '+00:00'. + :vartype utc_offset: str + :ivar start_date: The date the maintenance window activates. If the current date is before this + date, the maintenance window is inactive and will not be used for upgrades. If not specified, + the maintenance window will be active right away. + :vartype start_date: ~datetime.date + :ivar start_time: The start time of the maintenance window. Accepted values are from '00:00' to + '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means + UTC time '00:00'. Required. + :vartype start_time: str + :ivar not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to + 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.v2024_04_02_preview.models.DateSpan] + """ + + _validation = { + "schedule": {"required": True}, + "duration_hours": {"required": True, "maximum": 24, "minimum": 4}, + "utc_offset": {"pattern": r"^(-|\+)[0-9]{2}:[0-9]{2}$"}, + "start_time": {"required": True, "pattern": r"^\d{2}:\d{2}$"}, + } + + _attribute_map = { + "schedule": {"key": "schedule", "type": "Schedule"}, + "duration_hours": {"key": "durationHours", "type": "int"}, + "utc_offset": {"key": "utcOffset", "type": "str"}, + "start_date": {"key": "startDate", "type": "date"}, + "start_time": {"key": "startTime", "type": "str"}, + "not_allowed_dates": {"key": "notAllowedDates", "type": "[DateSpan]"}, + } + + def __init__( + self, + *, + schedule: "_models.Schedule", + duration_hours: int = 24, + start_time: str, + utc_offset: Optional[str] = None, + start_date: Optional[datetime.date] = None, + not_allowed_dates: Optional[List["_models.DateSpan"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword schedule: Recurrence schedule for the maintenance window. Required. + :paramtype schedule: ~azure.mgmt.containerservice.v2024_04_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 + '-07:00' for PST. If not specified, the default is '+00:00'. + :paramtype utc_offset: str + :keyword start_date: The date the maintenance window activates. If the current date is before + this date, the maintenance window is inactive and will not be used for upgrades. If not + specified, the maintenance window will be active right away. + :paramtype start_date: ~datetime.date + :keyword start_time: The start time of the maintenance window. Accepted values are from '00:00' + to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' + means UTC time '00:00'. Required. + :paramtype start_time: str + :keyword not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to + 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.v2024_04_02_preview.models.DateSpan] + """ + super().__init__(**kwargs) + self.schedule = schedule + self.duration_hours = duration_hours + self.utc_offset = utc_offset + self.start_date = start_date + self.start_time = start_time + self.not_allowed_dates = not_allowed_dates + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_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 + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": 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}"}, + "location": {"key": "location", "type": "str"}, + } + + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + """ + super().__init__(**kwargs) + self.tags = tags + self.location = location + + +class ManagedCluster(TrackedResource): # pylint: disable=too-many-instance-attributes + """Managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_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 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 sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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 + 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 1.14.x -> + 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :vartype kubernetes_version: str + :ivar current_kubernetes_version: The version of Kubernetes the Managed Cluster is running. + :vartype current_kubernetes_version: str + :ivar dns_prefix: This cannot be updated once the Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :vartype fqdn_subdomain: str + :ivar fqdn: The FQDN of the master pool. + :vartype fqdn: str + :ivar private_fqdn: The FQDN of private cluster. + :vartype private_fqdn: str + :ivar azure_portal_fqdn: The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) + headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. + This special FQDN supports CORS, allowing the Azure Portal to function properly. + :vartype azure_portal_fqdn: str + :ivar agent_pool_profiles: The agent pool properties. + :vartype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAgentPoolProfile] + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ContainerServiceLinuxProfile + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterServicePrincipalProfile + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterPodIdentityProfile + :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :vartype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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. + :vartype enable_pod_security_policy: bool + :ivar enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updating of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource. + :vartype enable_namespace_resources: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ContainerServiceNetworkProfile + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAutoUpgradeProfile + :ivar upgrade_settings: Settings for upgrading a cluster. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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 + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2024_04_02_preview.models.UserAssignedIdentity] + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: + list[~azure.mgmt.containerservice.v2024_04_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 + `_. + :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.v2024_04_02_preview.models.ManagedClusterHTTPProxyConfig + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSecurityProfile + :ivar storage_profile: Storage profile for the managed cluster. + :vartype storage_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfile + :ivar ingress_profile: Ingress profile for the managed cluster. + :vartype ingress_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + :ivar azure_monitor_profile: Prometheus addon profile for the container service cluster. + :vartype azure_monitor_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.SafeguardsProfile + :ivar service_mesh_profile: Service mesh profile for a managed cluster. + :vartype service_mesh_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterAIToolchainOperatorProfile + :ivar node_provisioning_profile: Node provisioning settings that apply to the whole cluster. + :vartype node_provisioning_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterNodeProvisioningProfile + :ivar bootstrap_profile: Profile of the cluster bootstrap configuration. + :vartype bootstrap_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterBootstrapProfile + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "e_tag": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "power_state": {"readonly": True}, + "max_agent_pools": {"readonly": True}, + "current_kubernetes_version": {"readonly": True}, + "fqdn": {"readonly": True}, + "private_fqdn": {"readonly": True}, + "azure_portal_fqdn": {"readonly": True}, + "resource_uid": {"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}"}, + "location": {"key": "location", "type": "str"}, + "e_tag": {"key": "eTag", "type": "str"}, + "sku": {"key": "sku", "type": "ManagedClusterSKU"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "identity": {"key": "identity", "type": "ManagedClusterIdentity"}, + "kind": {"key": "kind", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "power_state": {"key": "properties.powerState", "type": "PowerState"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "max_agent_pools": {"key": "properties.maxAgentPools", "type": "int"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "current_kubernetes_version": {"key": "properties.currentKubernetesVersion", "type": "str"}, + "dns_prefix": {"key": "properties.dnsPrefix", "type": "str"}, + "fqdn_subdomain": {"key": "properties.fqdnSubdomain", "type": "str"}, + "fqdn": {"key": "properties.fqdn", "type": "str"}, + "private_fqdn": {"key": "properties.privateFQDN", "type": "str"}, + "azure_portal_fqdn": {"key": "properties.azurePortalFQDN", "type": "str"}, + "agent_pool_profiles": {"key": "properties.agentPoolProfiles", "type": "[ManagedClusterAgentPoolProfile]"}, + "linux_profile": {"key": "properties.linuxProfile", "type": "ContainerServiceLinuxProfile"}, + "windows_profile": {"key": "properties.windowsProfile", "type": "ManagedClusterWindowsProfile"}, + "service_principal_profile": { + "key": "properties.servicePrincipalProfile", + "type": "ManagedClusterServicePrincipalProfile", + }, + "addon_profiles": {"key": "properties.addonProfiles", "type": "{ManagedClusterAddonProfile}"}, + "pod_identity_profile": {"key": "properties.podIdentityProfile", "type": "ManagedClusterPodIdentityProfile"}, + "oidc_issuer_profile": {"key": "properties.oidcIssuerProfile", "type": "ManagedClusterOIDCIssuerProfile"}, + "node_resource_group": {"key": "properties.nodeResourceGroup", "type": "str"}, + "node_resource_group_profile": { + "key": "properties.nodeResourceGroupProfile", + "type": "ManagedClusterNodeResourceGroupProfile", + }, + "enable_rbac": {"key": "properties.enableRBAC", "type": "bool"}, + "support_plan": {"key": "properties.supportPlan", "type": "str"}, + "enable_pod_security_policy": {"key": "properties.enablePodSecurityPolicy", "type": "bool"}, + "enable_namespace_resources": {"key": "properties.enableNamespaceResources", "type": "bool"}, + "network_profile": {"key": "properties.networkProfile", "type": "ContainerServiceNetworkProfile"}, + "aad_profile": {"key": "properties.aadProfile", "type": "ManagedClusterAADProfile"}, + "auto_upgrade_profile": {"key": "properties.autoUpgradeProfile", "type": "ManagedClusterAutoUpgradeProfile"}, + "upgrade_settings": {"key": "properties.upgradeSettings", "type": "ClusterUpgradeSettings"}, + "auto_scaler_profile": { + "key": "properties.autoScalerProfile", + "type": "ManagedClusterPropertiesAutoScalerProfile", + }, + "api_server_access_profile": { + "key": "properties.apiServerAccessProfile", + "type": "ManagedClusterAPIServerAccessProfile", + }, + "disk_encryption_set_id": {"key": "properties.diskEncryptionSetID", "type": "str"}, + "identity_profile": {"key": "properties.identityProfile", "type": "{UserAssignedIdentity}"}, + "private_link_resources": {"key": "properties.privateLinkResources", "type": "[PrivateLinkResource]"}, + "disable_local_accounts": {"key": "properties.disableLocalAccounts", "type": "bool"}, + "http_proxy_config": {"key": "properties.httpProxyConfig", "type": "ManagedClusterHTTPProxyConfig"}, + "security_profile": {"key": "properties.securityProfile", "type": "ManagedClusterSecurityProfile"}, + "storage_profile": {"key": "properties.storageProfile", "type": "ManagedClusterStorageProfile"}, + "ingress_profile": {"key": "properties.ingressProfile", "type": "ManagedClusterIngressProfile"}, + "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, + "workload_auto_scaler_profile": { + "key": "properties.workloadAutoScalerProfile", + "type": "ManagedClusterWorkloadAutoScalerProfile", + }, + "azure_monitor_profile": {"key": "properties.azureMonitorProfile", "type": "ManagedClusterAzureMonitorProfile"}, + "safeguards_profile": {"key": "properties.safeguardsProfile", "type": "SafeguardsProfile"}, + "service_mesh_profile": {"key": "properties.serviceMeshProfile", "type": "ServiceMeshProfile"}, + "resource_uid": {"key": "properties.resourceUID", "type": "str"}, + "metrics_profile": {"key": "properties.metricsProfile", "type": "ManagedClusterMetricsProfile"}, + "ai_toolchain_operator_profile": { + "key": "properties.aiToolchainOperatorProfile", + "type": "ManagedClusterAIToolchainOperatorProfile", + }, + "node_provisioning_profile": { + "key": "properties.nodeProvisioningProfile", + "type": "ManagedClusterNodeProvisioningProfile", + }, + "bootstrap_profile": {"key": "properties.bootstrapProfile", "type": "ManagedClusterBootstrapProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["_models.ManagedClusterSKU"] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + identity: Optional["_models.ManagedClusterIdentity"] = None, + kind: Optional[str] = None, + creation_data: Optional["_models.CreationData"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + fqdn_subdomain: Optional[str] = None, + agent_pool_profiles: Optional[List["_models.ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["_models.ContainerServiceLinuxProfile"] = None, + windows_profile: Optional["_models.ManagedClusterWindowsProfile"] = None, + service_principal_profile: Optional["_models.ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[Dict[str, "_models.ManagedClusterAddonProfile"]] = None, + pod_identity_profile: Optional["_models.ManagedClusterPodIdentityProfile"] = None, + oidc_issuer_profile: Optional["_models.ManagedClusterOIDCIssuerProfile"] = None, + node_resource_group: Optional[str] = None, + 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, + enable_namespace_resources: Optional[bool] = None, + network_profile: Optional["_models.ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["_models.ManagedClusterAADProfile"] = None, + auto_upgrade_profile: Optional["_models.ManagedClusterAutoUpgradeProfile"] = None, + upgrade_settings: Optional["_models.ClusterUpgradeSettings"] = None, + auto_scaler_profile: Optional["_models.ManagedClusterPropertiesAutoScalerProfile"] = None, + api_server_access_profile: Optional["_models.ManagedClusterAPIServerAccessProfile"] = None, + disk_encryption_set_id: Optional[str] = None, + identity_profile: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + private_link_resources: Optional[List["_models.PrivateLinkResource"]] = None, + disable_local_accounts: Optional[bool] = None, + http_proxy_config: Optional["_models.ManagedClusterHTTPProxyConfig"] = None, + security_profile: Optional["_models.ManagedClusterSecurityProfile"] = None, + storage_profile: Optional["_models.ManagedClusterStorageProfile"] = None, + ingress_profile: Optional["_models.ManagedClusterIngressProfile"] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, + workload_auto_scaler_profile: Optional["_models.ManagedClusterWorkloadAutoScalerProfile"] = None, + azure_monitor_profile: Optional["_models.ManagedClusterAzureMonitorProfile"] = None, + safeguards_profile: Optional["_models.SafeguardsProfile"] = None, + service_mesh_profile: Optional["_models.ServiceMeshProfile"] = None, + metrics_profile: Optional["_models.ManagedClusterMetricsProfile"] = None, + ai_toolchain_operator_profile: Optional["_models.ManagedClusterAIToolchainOperatorProfile"] = None, + node_provisioning_profile: Optional["_models.ManagedClusterNodeProvisioningProfile"] = None, + bootstrap_profile: Optional["_models.ManagedClusterBootstrapProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword sku: The managed cluster SKU. + :paramtype sku: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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 + 1.14.x -> 1.16.x is not allowed. See `upgrading an AKS cluster + `_ for more details. + :paramtype kubernetes_version: str + :keyword dns_prefix: This cannot be updated once the Managed Cluster has been created. + :paramtype dns_prefix: str + :keyword fqdn_subdomain: This cannot be updated once the Managed Cluster has been created. + :paramtype fqdn_subdomain: str + :keyword agent_pool_profiles: The agent pool properties. + :paramtype agent_pool_profiles: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterPodIdentityProfile + :keyword oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :paramtype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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. + :paramtype enable_pod_security_policy: bool + :keyword enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updating of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource. + :paramtype enable_namespace_resources: bool + :keyword network_profile: The network configuration profile. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAutoUpgradeProfile + :keyword upgrade_settings: Settings for upgrading a cluster. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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 + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2024_04_02_preview.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2024_04_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 + `_. + :paramtype disable_local_accounts: bool + :keyword http_proxy_config: Configurations for provisioning the cluster with HTTP proxy + servers. + :paramtype http_proxy_config: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSecurityProfile + :keyword storage_profile: Storage profile for the managed cluster. + :paramtype storage_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfile + :keyword ingress_profile: Ingress profile for the managed cluster. + :paramtype ingress_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + :keyword azure_monitor_profile: Prometheus addon profile for the container service cluster. + :paramtype azure_monitor_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.SafeguardsProfile + :keyword service_mesh_profile: Service mesh profile for a managed cluster. + :paramtype service_mesh_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ServiceMeshProfile + :keyword metrics_profile: Optional cluster metrics configuration. + :paramtype metrics_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterAIToolchainOperatorProfile + :keyword node_provisioning_profile: Node provisioning settings that apply to the whole cluster. + :paramtype node_provisioning_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterNodeProvisioningProfile + :keyword bootstrap_profile: Profile of the cluster bootstrap configuration. + :paramtype bootstrap_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterBootstrapProfile + """ + super().__init__(tags=tags, location=location, **kwargs) + self.e_tag = None + self.sku = sku + self.extended_location = extended_location + self.identity = identity + self.kind = kind + self.provisioning_state = None + self.power_state = None + self.creation_data = creation_data + self.max_agent_pools = None + self.kubernetes_version = kubernetes_version + self.current_kubernetes_version = None + self.dns_prefix = dns_prefix + self.fqdn_subdomain = fqdn_subdomain + self.fqdn = None + self.private_fqdn = None + self.azure_portal_fqdn = None + self.agent_pool_profiles = agent_pool_profiles + self.linux_profile = linux_profile + self.windows_profile = windows_profile + self.service_principal_profile = service_principal_profile + self.addon_profiles = addon_profiles + self.pod_identity_profile = pod_identity_profile + self.oidc_issuer_profile = oidc_issuer_profile + self.node_resource_group = node_resource_group + 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.enable_namespace_resources = enable_namespace_resources + self.network_profile = network_profile + self.aad_profile = aad_profile + self.auto_upgrade_profile = auto_upgrade_profile + self.upgrade_settings = upgrade_settings + self.auto_scaler_profile = auto_scaler_profile + self.api_server_access_profile = api_server_access_profile + self.disk_encryption_set_id = disk_encryption_set_id + self.identity_profile = identity_profile + self.private_link_resources = private_link_resources + self.disable_local_accounts = disable_local_accounts + self.http_proxy_config = http_proxy_config + self.security_profile = security_profile + self.storage_profile = storage_profile + self.ingress_profile = ingress_profile + self.public_network_access = public_network_access + self.workload_auto_scaler_profile = workload_auto_scaler_profile + self.azure_monitor_profile = azure_monitor_profile + self.safeguards_profile = safeguards_profile + self.service_mesh_profile = service_mesh_profile + self.resource_uid = None + self.metrics_profile = metrics_profile + self.ai_toolchain_operator_profile = ai_toolchain_operator_profile + self.node_provisioning_profile = node_provisioning_profile + self.bootstrap_profile = bootstrap_profile + + +class ManagedClusterAADProfile(_serialization.Model): + """For more details see `managed AAD on AKS `_. + + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: (DEPRECATED) The client AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype client_app_id: str + :ivar server_app_id: (DEPRECATED) The server AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype server_app_id: str + :ivar server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at + https://aka.ms/aks/aad-legacy. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :vartype tenant_id: str + """ + + _attribute_map = { + "managed": {"key": "managed", "type": "bool"}, + "enable_azure_rbac": {"key": "enableAzureRBAC", "type": "bool"}, + "admin_group_object_i_ds": {"key": "adminGroupObjectIDs", "type": "[str]"}, + "client_app_id": {"key": "clientAppID", "type": "str"}, + "server_app_id": {"key": "serverAppID", "type": "str"}, + "server_app_secret": {"key": "serverAppSecret", "type": "str"}, + "tenant_id": {"key": "tenantID", "type": "str"}, + } + + def __init__( + self, + *, + managed: Optional[bool] = None, + enable_azure_rbac: Optional[bool] = None, + admin_group_object_i_ds: Optional[List[str]] = None, + client_app_id: Optional[str] = None, + server_app_id: Optional[str] = None, + server_app_secret: Optional[str] = None, + tenant_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword managed: Whether to enable managed AAD. + :paramtype managed: bool + :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :paramtype enable_azure_rbac: bool + :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :paramtype admin_group_object_i_ds: list[str] + :keyword client_app_id: (DEPRECATED) The client AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype client_app_id: str + :keyword server_app_id: (DEPRECATED) The server AAD application ID. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype server_app_id: str + :keyword server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at + https://aka.ms/aks/aad-legacy. + :paramtype server_app_secret: str + :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :paramtype tenant_id: str + """ + super().__init__(**kwargs) + self.managed = managed + self.enable_azure_rbac = enable_azure_rbac + self.admin_group_object_i_ds = admin_group_object_i_ds + self.client_app_id = client_app_id + self.server_app_id = server_app_id + self.server_app_secret = server_app_secret + self.tenant_id = tenant_id + + +class ManagedClusterAccessProfile(TrackedResource): + """Managed cluster Access Profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_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 kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytes + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": 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}"}, + "location": {"key": "location", "type": "str"}, + "kube_config": {"key": "properties.kubeConfig", "type": "bytearray"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + kube_config: Optional[bytes] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword kube_config: Base64-encoded Kubernetes configuration file. + :paramtype kube_config: bytes + """ + super().__init__(tags=tags, location=location, **kwargs) + self.kube_config = kube_config + + +class ManagedClusterAddonProfile(_serialization.Model): + """A Kubernetes add-on profile for a managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether the add-on is enabled or not. Required. + :vartype enabled: bool + :ivar config: Key-value pairs for configuring an add-on. + :vartype config: dict[str, str] + :ivar identity: Information of user assigned identity used by this add-on. + :vartype identity: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAddonProfileIdentity + """ + + _validation = { + "enabled": {"required": True}, + "identity": {"readonly": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "config": {"key": "config", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedClusterAddonProfileIdentity"}, + } + + def __init__(self, *, enabled: bool, config: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether the add-on is enabled or not. Required. + :paramtype enabled: bool + :keyword config: Key-value pairs for configuring an add-on. + :paramtype config: dict[str, str] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.config = config + self.identity = None + + +class UserAssignedIdentity(_serialization.Model): + """Details about a user assigned identity. + + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str + """ + + _attribute_map = { + "resource_id": {"key": "resourceId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + "object_id": {"key": "objectId", "type": "str"}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword resource_id: The resource ID of the user assigned identity. + :paramtype resource_id: str + :keyword client_id: The client ID of the user assigned identity. + :paramtype client_id: str + :keyword object_id: The object ID of the user assigned identity. + :paramtype object_id: str + """ + super().__init__(**kwargs) + self.resource_id = resource_id + self.client_id = client_id + self.object_id = object_id + + +class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): + """Information of user assigned identity used by this add-on. + + :ivar resource_id: The resource ID of the user assigned identity. + :vartype resource_id: str + :ivar client_id: The client ID of the user assigned identity. + :vartype client_id: str + :ivar object_id: The object ID of the user assigned identity. + :vartype object_id: str + """ + + +class ManagedClusterAgentPoolProfileProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Properties for the container service agent pool profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_04_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.v2024_04_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.v2024_04_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_04_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.v2024_04_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.v2024_04_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_04_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.v2024_04_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.v2024_04_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_04_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.v2024_04_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_04_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_04_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_04_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.v2024_04_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 + 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.v2024_04_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.AgentPoolGatewayProfile + """ + + _validation = { + "e_tag": {"readonly": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "e_tag": {"key": "eTag", "type": "str"}, + "count": {"key": "count", "type": "int"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "maxPods", "type": "int"}, + "os_type": {"key": "osType", "type": "str"}, + "os_sku": {"key": "osSKU", "type": "str"}, + "max_count": {"key": "maxCount", "type": "int"}, + "min_count": {"key": "minCount", "type": "int"}, + "enable_auto_scaling": {"key": "enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "scaleDownMode", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "power_state": {"key": "powerState", "type": "PowerState"}, + "availability_zones": {"key": "availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "spotMaxPrice", "type": "float"}, + "tags": {"key": "tags", "type": "{str}"}, + "node_labels": {"key": "nodeLabels", "type": "{str}"}, + "node_taints": {"key": "nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "hostGroupID", "type": "str"}, + "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, + "virtual_machines_profile": {"key": "virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": {"key": "virtualMachineNodesStatus", "type": "[VirtualMachineNodes]"}, + "gateway_profile": {"key": "gatewayProfile", "type": "AgentPoolGatewayProfile"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_04_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.v2024_04_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.v2024_04_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_04_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.v2024_04_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.v2024_04_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_04_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.v2024_04_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.v2024_04_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_04_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.v2024_04_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_04_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_04_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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 + 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.v2024_04_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.AgentPoolGatewayProfile + """ + super().__init__(**kwargs) + self.e_tag = None + self.count = count + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.os_disk_type = os_disk_type + self.kubelet_disk_type = kubelet_disk_type + self.workload_runtime = workload_runtime + self.message_of_the_day = message_of_the_day + self.vnet_subnet_id = vnet_subnet_id + self.pod_subnet_id = pod_subnet_id + self.pod_ip_allocation_mode = pod_ip_allocation_mode + self.max_pods = max_pods + self.os_type = os_type + self.os_sku = os_sku + self.max_count = max_count + self.min_count = min_count + self.enable_auto_scaling = enable_auto_scaling + self.scale_down_mode = scale_down_mode + self.type = type + self.mode = mode + self.orchestrator_version = orchestrator_version + self.current_orchestrator_version = None + self.node_image_version = None + self.upgrade_settings = upgrade_settings + self.provisioning_state = None + self.power_state = power_state + self.availability_zones = availability_zones + self.enable_node_public_ip = enable_node_public_ip + self.enable_custom_ca_trust = enable_custom_ca_trust + self.node_public_ip_prefix_id = node_public_ip_prefix_id + self.scale_set_priority = scale_set_priority + self.scale_set_eviction_policy = scale_set_eviction_policy + self.spot_max_price = spot_max_price + self.tags = tags + self.node_labels = node_labels + self.node_taints = node_taints + self.node_initialization_taints = node_initialization_taints + self.proximity_placement_group_id = proximity_placement_group_id + self.kubelet_config = kubelet_config + self.linux_os_config = linux_os_config + self.enable_encryption_at_host = enable_encryption_at_host + self.enable_ultra_ssd = enable_ultra_ssd + self.enable_fips = enable_fips + self.gpu_instance_profile = gpu_instance_profile + self.creation_data = creation_data + self.capacity_reservation_group_id = capacity_reservation_group_id + self.host_group_id = host_group_id + self.windows_profile = windows_profile + self.network_profile = network_profile + self.security_profile = security_profile + self.gpu_profile = gpu_profile + self.artifact_streaming_profile = artifact_streaming_profile + self.virtual_machines_profile = virtual_machines_profile + self.virtual_machine_nodes_status = virtual_machine_nodes_status + self.gateway_profile = gateway_profile + + +class ManagedClusterAgentPoolProfile( + ManagedClusterAgentPoolProfileProperties +): # pylint: disable=too-many-instance-attributes + """Profile for the container service agent pool. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar 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 count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: VM size availability varies by region. If a node contains insufficient compute + resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted + VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :vartype vm_size: str + :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.v2024_04_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.v2024_04_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.v2024_04_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 + executed as a script). + :vartype message_of_the_day: str + :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 + :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 + :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.v2024_04_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.v2024_04_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.v2024_04_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. + :vartype min_count: int + :ivar enable_auto_scaling: Whether to enable auto-scaler. + :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.v2024_04_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.v2024_04_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.v2024_04_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: If orchestratorVersion was a fully specified version + , this field will be exactly equal to it. If orchestratorVersion was + , this field will contain the full version being used. + :vartype current_orchestrator_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + :ivar enable_node_public_ip: Some scenarios may require nodes in a node pool to receive 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 + `_. + The default is false. + :vartype enable_node_public_ip: bool + :ivar enable_custom_ca_trust: When set to true, AKS adds a label to the node indicating that + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_04_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.v2024_04_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 `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: These taints will not be reconciled by AKS and can be removed + with a kubectl call. This field can be modified after node pool is created, but nodes will not + be recreated with new taints until another operation that requires recreation (e.g. node image + upgrade) happens. These taints allow for required configuration to run before the node is ready + to accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with + ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :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.v2024_04_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2024_04_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. + :vartype enable_encryption_at_host: bool + :ivar enable_ultra_ssd: Whether to enable UltraSSD. + :vartype enable_ultra_ssd: bool + :ivar enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :vartype enable_fips: bool + :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.v2024_04_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.v2024_04_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 + 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.v2024_04_02_preview.models.AgentPoolWindowsProfile + :ivar network_profile: Network-related settings of an agent pool. + :vartype network_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolNetworkProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolSecurityProfile + :ivar gpu_profile: The GPU settings of an agent pool. + :vartype gpu_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolGPUProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.AgentPoolGatewayProfile + :ivar name: Windows agent pool names must be 6 characters or less. Required. + :vartype name: str + """ + + _validation = { + "e_tag": {"readonly": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "current_orchestrator_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "name": {"required": True, "pattern": r"^[a-z][a-z0-9]{0,11}$"}, + } + + _attribute_map = { + "e_tag": {"key": "eTag", "type": "str"}, + "count": {"key": "count", "type": "int"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, + "os_disk_type": {"key": "osDiskType", "type": "str"}, + "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, + "workload_runtime": {"key": "workloadRuntime", "type": "str"}, + "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, + "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, + "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, + "pod_ip_allocation_mode": {"key": "podIPAllocationMode", "type": "str"}, + "max_pods": {"key": "maxPods", "type": "int"}, + "os_type": {"key": "osType", "type": "str"}, + "os_sku": {"key": "osSKU", "type": "str"}, + "max_count": {"key": "maxCount", "type": "int"}, + "min_count": {"key": "minCount", "type": "int"}, + "enable_auto_scaling": {"key": "enableAutoScaling", "type": "bool"}, + "scale_down_mode": {"key": "scaleDownMode", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "mode": {"key": "mode", "type": "str"}, + "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, + "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, + "node_image_version": {"key": "nodeImageVersion", "type": "str"}, + "upgrade_settings": {"key": "upgradeSettings", "type": "AgentPoolUpgradeSettings"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "power_state": {"key": "powerState", "type": "PowerState"}, + "availability_zones": {"key": "availabilityZones", "type": "[str]"}, + "enable_node_public_ip": {"key": "enableNodePublicIP", "type": "bool"}, + "enable_custom_ca_trust": {"key": "enableCustomCATrust", "type": "bool"}, + "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, + "scale_set_priority": {"key": "scaleSetPriority", "type": "str"}, + "scale_set_eviction_policy": {"key": "scaleSetEvictionPolicy", "type": "str"}, + "spot_max_price": {"key": "spotMaxPrice", "type": "float"}, + "tags": {"key": "tags", "type": "{str}"}, + "node_labels": {"key": "nodeLabels", "type": "{str}"}, + "node_taints": {"key": "nodeTaints", "type": "[str]"}, + "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, + "proximity_placement_group_id": {"key": "proximityPlacementGroupID", "type": "str"}, + "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, + "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, + "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, + "enable_ultra_ssd": {"key": "enableUltraSSD", "type": "bool"}, + "enable_fips": {"key": "enableFIPS", "type": "bool"}, + "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, + "creation_data": {"key": "creationData", "type": "CreationData"}, + "capacity_reservation_group_id": {"key": "capacityReservationGroupID", "type": "str"}, + "host_group_id": {"key": "hostGroupID", "type": "str"}, + "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, + "network_profile": {"key": "networkProfile", "type": "AgentPoolNetworkProfile"}, + "security_profile": {"key": "securityProfile", "type": "AgentPoolSecurityProfile"}, + "gpu_profile": {"key": "gpuProfile", "type": "AgentPoolGPUProfile"}, + "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, + "virtual_machines_profile": {"key": "virtualMachinesProfile", "type": "VirtualMachinesProfile"}, + "virtual_machine_nodes_status": {"key": "virtualMachineNodesStatus", "type": "[VirtualMachineNodes]"}, + "gateway_profile": {"key": "gatewayProfile", "type": "AgentPoolGatewayProfile"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Union[str, "_models.OSType"] = "Linux", + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + max_count: Optional[int] = None, + min_count: Optional[int] = None, + enable_auto_scaling: Optional[bool] = None, + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, + type: Optional[Union[str, "_models.AgentPoolType"]] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + orchestrator_version: Optional[str] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[List[str]] = None, + enable_node_public_ip: Optional[bool] = None, + enable_custom_ca_trust: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", + scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", + spot_max_price: float = -1, + tags: Optional[Dict[str, str]] = None, + node_labels: Optional[Dict[str, str]] = None, + node_taints: Optional[List[str]] = None, + node_initialization_taints: Optional[List[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.AgentPoolGPUProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[List["_models.VirtualMachineNodes"]] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :paramtype count: int + :keyword vm_size: VM size availability varies by region. If a node contains insufficient + compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + :paramtype vm_size: str + :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.v2024_04_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.v2024_04_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.v2024_04_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 + executed as a script). + :paramtype message_of_the_day: str + :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 + :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 + :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.v2024_04_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.v2024_04_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.v2024_04_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. + :paramtype min_count: int + :keyword enable_auto_scaling: Whether to enable auto-scaler. + :paramtype enable_auto_scaling: bool + :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.v2024_04_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.v2024_04_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.v2024_04_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 + will not trigger an upgrade, even if a newer patch version is available. As a best practice, + you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node + pool version must have the same major version as the control plane. The node pool minor version + must be within two minor versions of the control plane version. The node pool version cannot be + greater than the control plane version. For more information see `upgrading a node pool + `_. + :paramtype orchestrator_version: str + :keyword upgrade_settings: Settings for upgrading the agentpool. + :paramtype upgrade_settings: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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] + :keyword enable_node_public_ip: Some scenarios may require nodes in a node pool to receive + 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 + the feature is enabled and deploys a daemonset along with host services to sync custom + certificate authorities from user-provided list of base64 encoded certificates into node trust + 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 + :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.v2024_04_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.v2024_04_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 `_. + :paramtype spot_max_price: float + :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. + :paramtype tags: dict[str, str] + :keyword node_labels: The node labels to be persisted across all nodes in agent pool. + :paramtype node_labels: dict[str, str] + :keyword node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :paramtype node_taints: list[str] + :keyword node_initialization_taints: These taints will not be reconciled by AKS and can be + removed with a kubectl call. This field can be modified after node pool is created, but nodes + will not be recreated with new taints until another operation that requires recreation (e.g. + node image upgrade) happens. These taints allow for required configuration to run before the + node is ready to accept workloads, for example 'key1=value1:NoSchedule' that then can be + removed with ``kubectl taint nodes node1 key1=value1:NoSchedule-``. + :paramtype node_initialization_taints: list[str] + :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.v2024_04_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2024_04_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. + :paramtype enable_encryption_at_host: bool + :keyword enable_ultra_ssd: Whether to enable UltraSSD. + :paramtype enable_ultra_ssd: bool + :keyword enable_fips: See `Add a FIPS-enabled node pool + `_ + for more details. + :paramtype enable_fips: bool + :keyword 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". + :paramtype gpu_instance_profile: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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 + 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.v2024_04_02_preview.models.AgentPoolWindowsProfile + :keyword network_profile: Network-related settings of an agent pool. + :paramtype network_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolNetworkProfile + :keyword security_profile: The security settings of an agent pool. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolSecurityProfile + :keyword gpu_profile: The GPU settings of an agent pool. + :paramtype gpu_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolGPUProfile + :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :paramtype artifact_streaming_profile: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolArtifactStreamingProfile + :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. + :paramtype virtual_machines_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.AgentPoolGatewayProfile + :keyword name: Windows agent pool names must be 6 characters or less. Required. + :paramtype name: str + """ + super().__init__( + count=count, + vm_size=vm_size, + os_disk_size_gb=os_disk_size_gb, + os_disk_type=os_disk_type, + kubelet_disk_type=kubelet_disk_type, + workload_runtime=workload_runtime, + message_of_the_day=message_of_the_day, + vnet_subnet_id=vnet_subnet_id, + pod_subnet_id=pod_subnet_id, + pod_ip_allocation_mode=pod_ip_allocation_mode, + max_pods=max_pods, + os_type=os_type, + os_sku=os_sku, + max_count=max_count, + min_count=min_count, + enable_auto_scaling=enable_auto_scaling, + scale_down_mode=scale_down_mode, + type=type, + mode=mode, + orchestrator_version=orchestrator_version, + upgrade_settings=upgrade_settings, + power_state=power_state, + availability_zones=availability_zones, + enable_node_public_ip=enable_node_public_ip, + enable_custom_ca_trust=enable_custom_ca_trust, + node_public_ip_prefix_id=node_public_ip_prefix_id, + scale_set_priority=scale_set_priority, + scale_set_eviction_policy=scale_set_eviction_policy, + spot_max_price=spot_max_price, + tags=tags, + node_labels=node_labels, + node_taints=node_taints, + node_initialization_taints=node_initialization_taints, + proximity_placement_group_id=proximity_placement_group_id, + kubelet_config=kubelet_config, + linux_os_config=linux_os_config, + enable_encryption_at_host=enable_encryption_at_host, + enable_ultra_ssd=enable_ultra_ssd, + enable_fips=enable_fips, + gpu_instance_profile=gpu_instance_profile, + creation_data=creation_data, + capacity_reservation_group_id=capacity_reservation_group_id, + host_group_id=host_group_id, + windows_profile=windows_profile, + network_profile=network_profile, + security_profile=security_profile, + gpu_profile=gpu_profile, + artifact_streaming_profile=artifact_streaming_profile, + virtual_machines_profile=virtual_machines_profile, + virtual_machine_nodes_status=virtual_machine_nodes_status, + gateway_profile=gateway_profile, + **kwargs + ) + self.name = name + + +class ManagedClusterAIToolchainOperatorProfile(_serialization.Model): + """When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the + cluster. The operator automates the deployment of OSS models for inference and/or training + purposes. It provides a set of preset models and enables distributed inference against them. + + :ivar enabled: Indicates if AI toolchain operator enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if AI toolchain operator enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterAPIServerAccessProfile(_serialization.Model): + """Access profile for managed cluster API server. + + :ivar authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :vartype authorized_ip_ranges: list[str] + :ivar enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The default is System. For more details see `configure private DNS zone + `_. Allowed + values are 'system' and 'none'. + :vartype private_dns_zone: str + :ivar enable_private_cluster_public_fqdn: Whether to create additional public FQDN for private + cluster or not. + :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. + :vartype enable_vnet_integration: bool + :ivar subnet_id: It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an + existing cluster to enable apiserver vnet integration. + :vartype subnet_id: str + """ + + _attribute_map = { + "authorized_ip_ranges": {"key": "authorizedIPRanges", "type": "[str]"}, + "enable_private_cluster": {"key": "enablePrivateCluster", "type": "bool"}, + "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__( + self, + *, + authorized_ip_ranges: Optional[List[str]] = None, + enable_private_cluster: Optional[bool] = None, + 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: + """ + :keyword authorized_ip_ranges: IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. + This feature is not compatible with clusters that use Public IP Per Node, or clusters that are + using a Basic Load Balancer. For more information see `API server authorized IP ranges + `_. + :paramtype authorized_ip_ranges: list[str] + :keyword enable_private_cluster: For more details, see `Creating a private AKS cluster + `_. + :paramtype enable_private_cluster: bool + :keyword private_dns_zone: The default is System. For more details see `configure private DNS + zone `_. + Allowed values are 'system' and 'none'. + :paramtype private_dns_zone: str + :keyword enable_private_cluster_public_fqdn: Whether to create additional public FQDN for + private cluster or not. + :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. + :paramtype enable_vnet_integration: bool + :keyword subnet_id: It is required when: 1. creating a new cluster with BYO Vnet; 2. updating + an existing cluster to enable apiserver vnet integration. + :paramtype subnet_id: str + """ + super().__init__(**kwargs) + self.authorized_ip_ranges = authorized_ip_ranges + self.enable_private_cluster = enable_private_cluster + 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): + """Auto upgrade profile for a managed cluster. + + :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.v2024_04_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.v2024_04_02_preview.models.NodeOSUpgradeChannel + """ + + _attribute_map = { + "upgrade_channel": {"key": "upgradeChannel", "type": "str"}, + "node_os_upgrade_channel": {"key": "nodeOSUpgradeChannel", "type": "str"}, + } + + def __init__( + self, + *, + upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = None, + node_os_upgrade_channel: Optional[Union[str, "_models.NodeOSUpgradeChannel"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade + channel `_. + Known values are: "rapid", "stable", "patch", "node-image", and "none". + :paramtype upgrade_channel: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.NodeOSUpgradeChannel + """ + super().__init__(**kwargs) + self.upgrade_channel = upgrade_channel + self.node_os_upgrade_channel = node_os_upgrade_channel + + +class ManagedClusterAzureMonitorProfile(_serialization.Model): + """Prometheus addon profile for the container service cluster. + + :ivar metrics: Metrics profile for the prometheus service addon. + :vartype metrics: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring + """ + + _attribute_map = { + "metrics": {"key": "metrics", "type": "ManagedClusterAzureMonitorProfileMetrics"}, + "container_insights": { + "key": "containerInsights", + "type": "ManagedClusterAzureMonitorProfileContainerInsights", + }, + "app_monitoring": {"key": "appMonitoring", "type": "ManagedClusterAzureMonitorProfileAppMonitoring"}, + } + + def __init__( + self, + *, + metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = None, + container_insights: Optional["_models.ManagedClusterAzureMonitorProfileContainerInsights"] = None, + app_monitoring: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoring"] = None, + **kwargs: Any + ) -> None: + """ + :keyword metrics: Metrics profile for the prometheus service addon. + :paramtype metrics: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoring + """ + super().__init__(**kwargs) + self.metrics = metrics + self.container_insights = container_insights + self.app_monitoring = app_monitoring + + +class ManagedClusterAzureMonitorProfileAppMonitoring(_serialization.Model): # pylint: disable=name-too-long + """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. + + :ivar auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes + Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based + SDKs to collect OpenTelemetry metrics, logs and traces of the application. See + aka.ms/AzureMonitorApplicationMonitoring for an overview. + :vartype auto_instrumentation: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation # pylint: disable=line-too-long + :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.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics # pylint: disable=line-too-long + :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.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs # pylint: disable=line-too-long + """ + + _attribute_map = { + "auto_instrumentation": { + "key": "autoInstrumentation", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation", + }, + "open_telemetry_metrics": { + "key": "openTelemetryMetrics", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics", + }, + "open_telemetry_logs": { + "key": "openTelemetryLogs", + "type": "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs", + }, + } + + def __init__( + self, + *, + auto_instrumentation: Optional[ + "_models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation" + ] = None, + open_telemetry_metrics: Optional[ + "_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics" + ] = None, + open_telemetry_logs: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs"] = None, + **kwargs: Any + ) -> None: + """ + :keyword auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes + Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based + SDKs to collect OpenTelemetry metrics, logs and traces of the application. See + aka.ms/AzureMonitorApplicationMonitoring for an overview. + :paramtype auto_instrumentation: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation # pylint: disable=line-too-long + :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.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics # pylint: disable=line-too-long + :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.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.auto_instrumentation = auto_instrumentation + self.open_telemetry_metrics = open_telemetry_metrics + self.open_telemetry_logs = open_telemetry_logs + + +class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation( + _serialization.Model +): # pylint: disable=name-too-long + """Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web + hook to auto-instrument Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry + metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for + an overview. + + :ivar enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs( + _serialization.Model +): # pylint: disable=name-too-long + """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. + + :ivar enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or + not. + :vartype enabled: bool + :ivar port: The Open Telemetry host port for Open Telemetry logs and traces. If not specified, + the default port is 28331. + :vartype port: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled + or not. + :paramtype enabled: bool + :keyword port: The Open Telemetry host port for Open Telemetry logs and traces. If not + specified, the default port is 28331. + :paramtype port: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.port = port + + +class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics( + _serialization.Model +): # pylint: disable=name-too-long + """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. + + :ivar enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + :vartype enabled: bool + :ivar port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the + default port is 28333. + :vartype port: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "port": {"key": "port", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, port: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + :paramtype enabled: bool + :keyword port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the + default port is 28333. + :paramtype port: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.port = port + + +class ManagedClusterAzureMonitorProfileContainerInsights(_serialization.Model): # pylint: disable=name-too-long + """Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout + & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview. + + :ivar enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log + Analytics Workspace for storing Azure Monitor Container Insights Logs. + :vartype log_analytics_workspace_resource_id: str + :ivar syslog_port: The syslog host port. If not specified, the default port is 28330. + :vartype syslog_port: int + :ivar disable_custom_metrics: Indicates whether custom metrics collection has to be disabled or + not. If not specified the default is false. No custom metrics will be emitted if this field is + false but the container insights enabled field is false. + :vartype disable_custom_metrics: bool + :ivar disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is + disabled or not. If not specified the default is false. No prometheus metrics will be emitted + if this field is false but the container insights enabled field is false. + :vartype disable_prometheus_metrics_scraping: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, + "syslog_port": {"key": "syslogPort", "type": "int"}, + "disable_custom_metrics": {"key": "disableCustomMetrics", "type": "bool"}, + "disable_prometheus_metrics_scraping": {"key": "disablePrometheusMetricsScraping", "type": "bool"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + log_analytics_workspace_resource_id: Optional[str] = None, + syslog_port: Optional[int] = None, + disable_custom_metrics: Optional[bool] = None, + disable_prometheus_metrics_scraping: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + :paramtype enabled: bool + :keyword log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log + Analytics Workspace for storing Azure Monitor Container Insights Logs. + :paramtype log_analytics_workspace_resource_id: str + :keyword syslog_port: The syslog host port. If not specified, the default port is 28330. + :paramtype syslog_port: int + :keyword disable_custom_metrics: Indicates whether custom metrics collection has to be disabled + or not. If not specified the default is false. No custom metrics will be emitted if this field + is false but the container insights enabled field is false. + :paramtype disable_custom_metrics: bool + :keyword disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is + disabled or not. If not specified the default is false. No prometheus metrics will be emitted + if this field is false but the container insights enabled field is false. + :paramtype disable_prometheus_metrics_scraping: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + self.syslog_port = syslog_port + self.disable_custom_metrics = disable_custom_metrics + self.disable_prometheus_metrics_scraping = disable_prometheus_metrics_scraping + + +class ManagedClusterAzureMonitorProfileKubeStateMetrics(_serialization.Model): # pylint: disable=name-too-long + """Kube State Metrics for prometheus addon profile for the container service cluster. + + :ivar metric_labels_allowlist: Comma-separated list of Kubernetes annotations keys that will be + used in the resource's labels metric. + :vartype metric_labels_allowlist: str + :ivar metric_annotations_allow_list: Comma-separated list of additional Kubernetes label keys + that will be used in the resource's labels metric. + :vartype metric_annotations_allow_list: str + """ + + _attribute_map = { + "metric_labels_allowlist": {"key": "metricLabelsAllowlist", "type": "str"}, + "metric_annotations_allow_list": {"key": "metricAnnotationsAllowList", "type": "str"}, + } + + def __init__( + self, + *, + metric_labels_allowlist: Optional[str] = None, + metric_annotations_allow_list: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword metric_labels_allowlist: Comma-separated list of Kubernetes annotations keys that will + be used in the resource's labels metric. + :paramtype metric_labels_allowlist: str + :keyword metric_annotations_allow_list: Comma-separated list of additional Kubernetes label + keys that will be used in the resource's labels metric. + :paramtype metric_annotations_allow_list: str + """ + super().__init__(**kwargs) + self.metric_labels_allowlist = metric_labels_allowlist + self.metric_annotations_allow_list = metric_annotations_allow_list + + +class ManagedClusterAzureMonitorProfileMetrics(_serialization.Model): + """Metrics profile for the prometheus service addon. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable the Prometheus collector. Required. + :vartype enabled: bool + :ivar kube_state_metrics: Kube State Metrics for prometheus addon profile for the container + service cluster. + :vartype kube_state_metrics: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "kube_state_metrics": {"key": "kubeStateMetrics", "type": "ManagedClusterAzureMonitorProfileKubeStateMetrics"}, + } + + def __init__( + self, + *, + enabled: bool, + kube_state_metrics: Optional["_models.ManagedClusterAzureMonitorProfileKubeStateMetrics"] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable the Prometheus collector. Required. + :paramtype enabled: bool + :keyword kube_state_metrics: Kube State Metrics for prometheus addon profile for the container + service cluster. + :paramtype kube_state_metrics: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + """ + super().__init__(**kwargs) + self.enabled = enabled + self.kube_state_metrics = kube_state_metrics + + +class ManagedClusterBootstrapProfile(_serialization.Model): + """The bootstrap profile. + + :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.v2024_04_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 + """ + + _attribute_map = { + "artifact_source": {"key": "artifactSource", "type": "str"}, + "container_registry_id": {"key": "containerRegistryId", "type": "str"}, + } + + def __init__( + self, + *, + artifact_source: Union[str, "_models.ArtifactSource"] = "Direct", + container_registry_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_04_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 + """ + super().__init__(**kwargs) + self.artifact_source = artifact_source + self.container_registry_id = container_registry_id + + +class ManagedClusterCostAnalysis(_serialization.Model): + """The cost analysis configuration for the cluster. + + :ivar enabled: The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable + this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost + Analysis views in the Azure portal. If not specified, the default is false. For more + information see aka.ms/aks/docs/cost-analysis. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable + this feature. Enabling this will add Kubernetes Namespace and Deployment details to the Cost + Analysis views in the Azure portal. If not specified, the default is false. For more + information see aka.ms/aks/docs/cost-analysis. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterHTTPProxyConfig(_serialization.Model): + """Cluster HTTP proxy configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar effective_no_proxy: A read-only list of all endpoints for which traffic should not be + sent to the proxy. This list is a superset of noProxy and values injected by AKS. + :vartype effective_no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str + """ + + _validation = { + "effective_no_proxy": {"readonly": True}, + } + + _attribute_map = { + "http_proxy": {"key": "httpProxy", "type": "str"}, + "https_proxy": {"key": "httpsProxy", "type": "str"}, + "no_proxy": {"key": "noProxy", "type": "[str]"}, + "effective_no_proxy": {"key": "effectiveNoProxy", "type": "[str]"}, + "trusted_ca": {"key": "trustedCa", "type": "str"}, + } + + def __init__( + self, + *, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, + no_proxy: Optional[List[str]] = None, + trusted_ca: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ + super().__init__(**kwargs) + self.http_proxy = http_proxy + self.https_proxy = https_proxy + self.no_proxy = no_proxy + self.effective_no_proxy = None + self.trusted_ca = trusted_ca + + +class ManagedClusterIdentity(_serialization.Model): + """Identity for the managed cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of the system assigned identity which is used by master + components. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the system assigned identity which is used by master + components. + :vartype tenant_id: str + :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.v2024_04_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.v2024_04_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 + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "delegated_resources": {"key": "delegatedResources", "type": "{DelegatedResource}"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{ManagedServiceIdentityUserAssignedIdentitiesValue}", + }, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, + delegated_resources: Optional[Dict[str, "_models.DelegatedResource"]] = None, + user_assigned_identities: Optional[ + Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"] + ] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_04_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.v2024_04_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 + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.delegated_resources = delegated_resources + self.user_assigned_identities = user_assigned_identities + + +class ManagedClusterIngressProfile(_serialization.Model): + """Ingress profile for the container service cluster. + + :ivar web_app_routing: Web App Routing settings for the ingress profile. + :vartype web_app_routing: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterIngressProfileWebAppRouting + """ + + _attribute_map = { + "web_app_routing": {"key": "webAppRouting", "type": "ManagedClusterIngressProfileWebAppRouting"}, + } + + def __init__( + self, *, web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = None, **kwargs: Any + ) -> None: + """ + :keyword web_app_routing: Web App Routing settings for the ingress profile. + :paramtype web_app_routing: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterIngressProfileWebAppRouting + """ + super().__init__(**kwargs) + self.web_app_routing = web_app_routing + + +class ManagedClusterIngressProfileWebAppRouting(_serialization.Model): # pylint: disable=name-too-long + """Web App Routing settings for the ingress profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar enabled: Whether to enable Web App Routing. + :vartype enabled: bool + :ivar dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the Web App + Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be + in different resource groups, but all public DNS zones must be in the same resource group and + all private DNS zones must be in the same resource group. + :vartype dns_zone_resource_ids: list[str] + :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.v2024_04_02_preview.models.UserAssignedIdentity + """ + + _validation = { + "dns_zone_resource_ids": {"max_items": 5, "min_items": 0}, + "identity": {"readonly": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "dns_zone_resource_ids": {"key": "dnsZoneResourceIds", "type": "[str]"}, + "identity": {"key": "identity", "type": "UserAssignedIdentity"}, + } + + def __init__( + self, *, enabled: Optional[bool] = None, dns_zone_resource_ids: Optional[List[str]] = None, **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable Web App Routing. + :paramtype enabled: bool + :keyword dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the Web App + Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be + in different resource groups, but all public DNS zones must be in the same resource group and + all private DNS zones must be in the same resource group. + :paramtype dns_zone_resource_ids: list[str] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.dns_zone_resource_ids = dns_zone_resource_ids + self.identity = None + + +class ManagedClusterListResult(_serialization.Model): + """The response from the List Managed Clusters operation. + + 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.v2024_04_02_preview.models.ManagedCluster] + :ivar next_link: The URL to get the next set of managed cluster results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ManagedCluster]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_04_02_preview.models.ManagedCluster] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterLoadBalancerProfile(_serialization.Model): + """Profile of the managed cluster load balancer. + + :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :vartype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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. + :vartype allocated_outbound_ports: int + :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 30 minutes. + :vartype idle_timeout_in_minutes: int + :ivar enable_multiple_standard_load_balancers: Enable multiple standard load balancers per AKS + cluster or not. + :vartype enable_multiple_standard_load_balancers: bool + :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.v2024_04_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.v2024_04_02_preview.models.ClusterServiceLoadBalancerHealthProbeMode + """ + + _validation = { + "allocated_outbound_ports": {"maximum": 64000, "minimum": 0}, + "idle_timeout_in_minutes": {"maximum": 120, "minimum": 4}, + } + + _attribute_map = { + "managed_outbound_i_ps": { + "key": "managedOutboundIPs", + "type": "ManagedClusterLoadBalancerProfileManagedOutboundIPs", + }, + "outbound_ip_prefixes": { + "key": "outboundIPPrefixes", + "type": "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + }, + "outbound_i_ps": {"key": "outboundIPs", "type": "ManagedClusterLoadBalancerProfileOutboundIPs"}, + "effective_outbound_i_ps": {"key": "effectiveOutboundIPs", "type": "[ResourceReference]"}, + "allocated_outbound_ports": {"key": "allocatedOutboundPorts", "type": "int"}, + "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, + "enable_multiple_standard_load_balancers": {"key": "enableMultipleStandardLoadBalancers", "type": "bool"}, + "backend_pool_type": {"key": "backendPoolType", "type": "str"}, + "cluster_service_load_balancer_health_probe_mode": { + "key": "clusterServiceLoadBalancerHealthProbeMode", + "type": "str", + }, + } + + def __init__( + self, + *, + managed_outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileManagedOutboundIPs"] = None, + outbound_ip_prefixes: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes"] = None, + outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPs"] = None, + effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None, + allocated_outbound_ports: int = 0, + idle_timeout_in_minutes: int = 30, + enable_multiple_standard_load_balancers: Optional[bool] = None, + backend_pool_type: Union[str, "_models.BackendPoolType"] = "NodeIPConfiguration", + cluster_service_load_balancer_health_probe_mode: Union[ + str, "_models.ClusterServiceLoadBalancerHealthProbeMode" + ] = "ServiceNodePort", + **kwargs: Any + ) -> None: + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPs + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster load + balancer. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ResourceReference] + :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. + :paramtype allocated_outbound_ports: int + :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 30 minutes. + :paramtype idle_timeout_in_minutes: int + :keyword enable_multiple_standard_load_balancers: Enable multiple standard load balancers per + AKS cluster or not. + :paramtype enable_multiple_standard_load_balancers: bool + :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.v2024_04_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.v2024_04_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 = effective_outbound_i_ps + 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 + self.backend_pool_type = backend_pool_type + self.cluster_service_load_balancer_health_probe_mode = cluster_service_load_balancer_health_probe_mode + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(_serialization.Model): # pylint: disable=name-too-long + """Desired managed outbound IPs for the cluster load balancer. + + :ivar count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :vartype count: int + :ivar count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :vartype count_ipv6: int + """ + + _validation = { + "count": {"maximum": 100, "minimum": 1}, + "count_ipv6": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + "count_ipv6": {"key": "countIPv6", "type": "int"}, + } + + def __init__(self, *, count: int = 1, count_ipv6: int = 0, **kwargs: Any) -> None: + """ + :keyword count: The desired number of IPv4 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 1. + :paramtype count: int + :keyword count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :paramtype count_ipv6: int + """ + super().__init__(**kwargs) + self.count = count + self.count_ipv6 = count_ipv6 + + +class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(_serialization.Model): # pylint: disable=name-too-long + """Desired outbound IP Prefix resources for the cluster load balancer. + + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ResourceReference] + """ + + _attribute_map = { + "public_ip_prefixes": {"key": "publicIPPrefixes", "type": "[ResourceReference]"}, + } + + def __init__( + self, *, public_ip_prefixes: Optional[List["_models.ResourceReference"]] = None, **kwargs: Any + ) -> None: + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ResourceReference] + """ + super().__init__(**kwargs) + self.public_ip_prefixes = public_ip_prefixes + + +class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): # pylint: disable=name-too-long + """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.v2024_04_02_preview.models.ResourceReference] + """ + + _attribute_map = { + "public_i_ps": {"key": "publicIPs", "type": "[ResourceReference]"}, + } + + 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.v2024_04_02_preview.models.ResourceReference] + """ + super().__init__(**kwargs) + self.public_i_ps = public_i_ps + + +class ManagedClusterManagedOutboundIPProfile(_serialization.Model): + """Profile of the managed outbound IP resources of the managed cluster. + + :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must + be in the range of 1 to 16 (inclusive). The default value is 1. + :vartype count: int + """ + + _validation = { + "count": {"maximum": 16, "minimum": 1}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, count: int = 1, **kwargs: Any) -> None: + """ + :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values + must be in the range of 1 to 16 (inclusive). The default value is 1. + :paramtype count: int + """ + super().__init__(**kwargs) + self.count = count + + +class ManagedClusterMetricsProfile(_serialization.Model): + """The metrics profile for the ManagedCluster. + + :ivar cost_analysis: The cost analysis configuration for the cluster. + :vartype cost_analysis: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterCostAnalysis + """ + + _attribute_map = { + "cost_analysis": {"key": "costAnalysis", "type": "ManagedClusterCostAnalysis"}, + } + + def __init__(self, *, cost_analysis: Optional["_models.ManagedClusterCostAnalysis"] = None, **kwargs: Any) -> None: + """ + :keyword cost_analysis: The cost analysis configuration for the cluster. + :paramtype cost_analysis: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterCostAnalysis + """ + super().__init__(**kwargs) + self.cost_analysis = cost_analysis + + +class ManagedClusterNATGatewayProfile(_serialization.Model): + """Profile of the managed cluster NAT gateway. + + :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.v2024_04_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.v2024_04_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 + """ + + _validation = { + "idle_timeout_in_minutes": {"maximum": 120, "minimum": 4}, + } + + _attribute_map = { + "managed_outbound_ip_profile": { + "key": "managedOutboundIPProfile", + "type": "ManagedClusterManagedOutboundIPProfile", + }, + "effective_outbound_i_ps": {"key": "effectiveOutboundIPs", "type": "[ResourceReference]"}, + "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, + } + + def __init__( + self, + *, + managed_outbound_ip_profile: Optional["_models.ManagedClusterManagedOutboundIPProfile"] = None, + effective_outbound_i_ps: Optional[List["_models.ResourceReference"]] = None, + idle_timeout_in_minutes: int = 4, + **kwargs: Any + ) -> None: + """ + :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.v2024_04_02_preview.models.ManagedClusterManagedOutboundIPProfile + :keyword effective_outbound_i_ps: The effective outbound IP resources of the cluster NAT + gateway. + :paramtype effective_outbound_i_ps: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ResourceReference] + :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 = effective_outbound_i_ps + self.idle_timeout_in_minutes = idle_timeout_in_minutes + + +class ManagedClusterNodeProvisioningProfile(_serialization.Model): + """ManagedClusterNodeProvisioningProfile. + + :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.v2024_04_02_preview.models.NodeProvisioningMode + """ + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + } + + def __init__(self, *, mode: Optional[Union[str, "_models.NodeProvisioningMode"]] = None, **kwargs: Any) -> None: + """ + :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.v2024_04_02_preview.models.NodeProvisioningMode + """ + super().__init__(**kwargs) + self.mode = mode + + +class ManagedClusterNodeResourceGroupProfile(_serialization.Model): + """Node resource group lockdown profile for a managed cluster. + + :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.v2024_04_02_preview.models.RestrictionLevel + """ + + _attribute_map = { + "restriction_level": {"key": "restrictionLevel", "type": "str"}, + } + + def __init__( + self, *, restriction_level: Optional[Union[str, "_models.RestrictionLevel"]] = None, **kwargs: Any + ) -> None: + """ + :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.v2024_04_02_preview.models.RestrictionLevel + """ + super().__init__(**kwargs) + self.restriction_level = restriction_level + + +class ManagedClusterOIDCIssuerProfile(_serialization.Model): + """The OIDC issuer profile of the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar issuer_url: The OIDC issuer url of the Managed Cluster. + :vartype issuer_url: str + :ivar enabled: Whether the OIDC issuer is enabled. + :vartype enabled: bool + """ + + _validation = { + "issuer_url": {"readonly": True}, + } + + _attribute_map = { + "issuer_url": {"key": "issuerURL", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether the OIDC issuer is enabled. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.issuer_url = None + self.enabled = enabled + + +class ManagedClusterPodIdentity(_serialization.Model): + """Details about the pod identity assigned to the Managed Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the pod identity. Required. + :vartype name: str + :ivar namespace: The namespace of the pod identity. Required. + :vartype namespace: str + :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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityProvisioningInfo + """ + + _validation = { + "name": {"required": True}, + "namespace": {"required": True}, + "identity": {"required": True}, + "provisioning_state": {"readonly": True}, + "provisioning_info": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "binding_selector": {"key": "bindingSelector", "type": "str"}, + "identity": {"key": "identity", "type": "UserAssignedIdentity"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "provisioning_info": {"key": "provisioningInfo", "type": "ManagedClusterPodIdentityProvisioningInfo"}, + } + + def __init__( + self, + *, + name: str, + namespace: str, + identity: "_models.UserAssignedIdentity", + binding_selector: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the pod identity. Required. + :paramtype name: str + :keyword namespace: The namespace of the pod identity. Required. + :paramtype namespace: str + :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.v2024_04_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 + + +class ManagedClusterPodIdentityException(_serialization.Model): + """See `disable AAD Pod Identity for a specific Pod/Application + `_ for more + details. + + All required parameters must be populated in order to send to server. + + :ivar name: The name of the pod identity exception. Required. + :vartype name: str + :ivar namespace: The namespace of the pod identity exception. Required. + :vartype namespace: str + :ivar pod_labels: The pod labels to match. Required. + :vartype pod_labels: dict[str, str] + """ + + _validation = { + "name": {"required": True}, + "namespace": {"required": True}, + "pod_labels": {"required": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "pod_labels": {"key": "podLabels", "type": "{str}"}, + } + + def __init__(self, *, name: str, namespace: str, pod_labels: Dict[str, str], **kwargs: Any) -> None: + """ + :keyword name: The name of the pod identity exception. Required. + :paramtype name: str + :keyword namespace: The namespace of the pod identity exception. Required. + :paramtype namespace: str + :keyword pod_labels: The pod labels to match. Required. + :paramtype pod_labels: dict[str, str] + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.pod_labels = pod_labels + + +class ManagedClusterPodIdentityProfile(_serialization.Model): + """See `use AAD pod identity `_ + for more details on pod identity integration. + + :ivar enabled: Whether the pod identity addon is enabled. + :vartype enabled: bool + :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.v2024_04_02_preview.models.ManagedClusterPodIdentity] + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityException] + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "allow_network_plugin_kubenet": {"key": "allowNetworkPluginKubenet", "type": "bool"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "[ManagedClusterPodIdentity]"}, + "user_assigned_identity_exceptions": { + "key": "userAssignedIdentityExceptions", + "type": "[ManagedClusterPodIdentityException]", + }, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + allow_network_plugin_kubenet: Optional[bool] = None, + user_assigned_identities: Optional[List["_models.ManagedClusterPodIdentity"]] = None, + user_assigned_identity_exceptions: Optional[List["_models.ManagedClusterPodIdentityException"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether the pod identity addon is enabled. + :paramtype enabled: bool + :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.v2024_04_02_preview.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityException] + """ + super().__init__(**kwargs) + self.enabled = enabled + self.allow_network_plugin_kubenet = allow_network_plugin_kubenet + self.user_assigned_identities = user_assigned_identities + self.user_assigned_identity_exceptions = user_assigned_identity_exceptions + + +class ManagedClusterPodIdentityProvisioningError(_serialization.Model): # pylint: disable=name-too-long + """An error response from the pod identity provisioning. + + :ivar error: Details about the error. + :vartype error: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningErrorBody"}, + } + + def __init__( + self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs: Any + ) -> None: + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + super().__init__(**kwargs) + self.error = error + + +class ManagedClusterPodIdentityProvisioningErrorBody(_serialization.Model): # pylint: disable=name-too-long + """An error response from the pod identity provisioning. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ManagedClusterPodIdentityProvisioningErrorBody]"}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["_models.ManagedClusterPodIdentityProvisioningErrorBody"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :paramtype code: str + :keyword message: A message describing the error, intended to be suitable for display in a user + interface. + :paramtype message: str + :keyword target: The target of the particular error. For example, the name of the property in + error. + :paramtype target: str + :keyword details: A list of additional details about the error. + :paramtype details: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ManagedClusterPodIdentityProvisioningInfo(_serialization.Model): # pylint: disable=name-too-long + """ManagedClusterPodIdentityProvisioningInfo. + + :ivar error: Pod identity assignment error (if any). + :vartype error: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningError"}, + } + + def __init__( + self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = None, **kwargs: Any + ) -> None: + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPodIdentityProvisioningError + """ + super().__init__(**kwargs) + self.error = error + + +class ManagedClusterPoolUpgradeProfile(_serialization.Model): + """The list of available upgrade versions. + + All required parameters must be populated in order to send to server. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :vartype kubernetes_version: str + :ivar name: The Agent Pool name. + :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.v2024_04_02_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + :ivar components_by_releases: components of given Kubernetes version. + :vartype components_by_releases: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ComponentsByReleases + """ + + _validation = { + "kubernetes_version": {"required": True}, + "os_type": {"required": True}, + } + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "os_type": {"key": "osType", "type": "str"}, + "upgrades": {"key": "upgrades", "type": "[ManagedClusterPoolUpgradeProfileUpgradesItem]"}, + "components_by_releases": {"key": "componentsByReleases", "type": "ComponentsByReleases"}, + } + + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "_models.OSType"] = "Linux", + name: Optional[str] = None, + upgrades: Optional[List["_models.ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + components_by_releases: Optional["_models.ComponentsByReleases"] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). Required. + :paramtype kubernetes_version: str + :keyword name: The Agent Pool name. + :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.v2024_04_02_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + :keyword components_by_releases: components of given Kubernetes version. + :paramtype components_by_releases: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ComponentsByReleases + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.name = name + self.os_type = os_type + self.upgrades = upgrades + self.components_by_releases = components_by_releases + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(_serialization.Model): # pylint: disable=name-too-long + """ManagedClusterPoolUpgradeProfileUpgradesItem. + + :ivar kubernetes_version: The Kubernetes version (major.minor.patch). + :vartype kubernetes_version: str + :ivar is_preview: Whether the Kubernetes version is currently in preview. + :vartype is_preview: bool + """ + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "is_preview": {"key": "isPreview", "type": "bool"}, + } + + def __init__( + self, *, kubernetes_version: Optional[str] = None, is_preview: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The Kubernetes version (major.minor.patch). + :paramtype kubernetes_version: str + :keyword is_preview: Whether the Kubernetes version is currently in preview. + :paramtype is_preview: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.is_preview = is_preview + + +class ManagedClusterPropertiesAutoScalerProfile( + _serialization.Model +): # pylint: disable=too-many-instance-attributes,name-too-long + """Parameters to be applied to the cluster-autoscaler when enabled. + + :ivar balance_similar_node_groups: Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar daemonset_eviction_for_empty_nodes: If set to true, all daemonset pods on empty nodes + will be evicted before deletion of the node. If the daemonset pod cannot be evicted another + node will be chosen for scaling. If set to false, the node will be deleted without ensuring + that daemonset pods are deleted or evicted. + :vartype daemonset_eviction_for_empty_nodes: bool + :ivar daemonset_eviction_for_occupied_nodes: If set to true, all daemonset pods on occupied + nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted + another node will be chosen for scaling. If set to false, the node will be deleted without + ensuring that daemonset pods are deleted or evicted. + :vartype daemonset_eviction_for_occupied_nodes: bool + :ivar ignore_daemonsets_utilization: If set to true, the resources used by daemonset will be + taken into account when making scaling down decisions. + :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.v2024_04_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. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The default is '15m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype max_node_provision_time: str + :ivar max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is 0. + :vartype max_total_unready_percentage: str + :ivar new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA to + act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :vartype new_pod_scale_up_delay: str + :ivar ok_total_unready_count: This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: The default is '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_add: str + :ivar scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_delete: str + :ivar scale_down_delay_after_failure: The default is '3m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_delay_after_failure: str + :ivar scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_unneeded_time: str + :ivar scale_down_unready_time: The default is '20m'. Values must be an integer followed by an + 'm'. No unit of time other than minutes (m) is supported. + :vartype scale_down_unready_time: str + :ivar scale_down_utilization_threshold: The default is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: The default is true. + :vartype skip_nodes_with_system_pods: str + """ + + _attribute_map = { + "balance_similar_node_groups": {"key": "balance-similar-node-groups", "type": "str"}, + "daemonset_eviction_for_empty_nodes": {"key": "daemonset-eviction-for-empty-nodes", "type": "bool"}, + "daemonset_eviction_for_occupied_nodes": {"key": "daemonset-eviction-for-occupied-nodes", "type": "bool"}, + "ignore_daemonsets_utilization": {"key": "ignore-daemonsets-utilization", "type": "bool"}, + "expander": {"key": "expander", "type": "str"}, + "max_empty_bulk_delete": {"key": "max-empty-bulk-delete", "type": "str"}, + "max_graceful_termination_sec": {"key": "max-graceful-termination-sec", "type": "str"}, + "max_node_provision_time": {"key": "max-node-provision-time", "type": "str"}, + "max_total_unready_percentage": {"key": "max-total-unready-percentage", "type": "str"}, + "new_pod_scale_up_delay": {"key": "new-pod-scale-up-delay", "type": "str"}, + "ok_total_unready_count": {"key": "ok-total-unready-count", "type": "str"}, + "scan_interval": {"key": "scan-interval", "type": "str"}, + "scale_down_delay_after_add": {"key": "scale-down-delay-after-add", "type": "str"}, + "scale_down_delay_after_delete": {"key": "scale-down-delay-after-delete", "type": "str"}, + "scale_down_delay_after_failure": {"key": "scale-down-delay-after-failure", "type": "str"}, + "scale_down_unneeded_time": {"key": "scale-down-unneeded-time", "type": "str"}, + "scale_down_unready_time": {"key": "scale-down-unready-time", "type": "str"}, + "scale_down_utilization_threshold": {"key": "scale-down-utilization-threshold", "type": "str"}, + "skip_nodes_with_local_storage": {"key": "skip-nodes-with-local-storage", "type": "str"}, + "skip_nodes_with_system_pods": {"key": "skip-nodes-with-system-pods", "type": "str"}, + } + + def __init__( + self, + *, + balance_similar_node_groups: Optional[str] = None, + daemonset_eviction_for_empty_nodes: Optional[bool] = None, + daemonset_eviction_for_occupied_nodes: Optional[bool] = None, + ignore_daemonsets_utilization: Optional[bool] = None, + expander: Optional[Union[str, "_models.Expander"]] = None, + max_empty_bulk_delete: Optional[str] = None, + max_graceful_termination_sec: Optional[str] = None, + max_node_provision_time: Optional[str] = None, + max_total_unready_percentage: Optional[str] = None, + new_pod_scale_up_delay: Optional[str] = None, + ok_total_unready_count: Optional[str] = None, + scan_interval: Optional[str] = None, + scale_down_delay_after_add: Optional[str] = None, + scale_down_delay_after_delete: Optional[str] = None, + scale_down_delay_after_failure: Optional[str] = None, + scale_down_unneeded_time: Optional[str] = None, + scale_down_unready_time: Optional[str] = None, + scale_down_utilization_threshold: Optional[str] = None, + skip_nodes_with_local_storage: Optional[str] = None, + skip_nodes_with_system_pods: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword daemonset_eviction_for_empty_nodes: If set to true, all daemonset pods on empty nodes + will be evicted before deletion of the node. If the daemonset pod cannot be evicted another + node will be chosen for scaling. If set to false, the node will be deleted without ensuring + that daemonset pods are deleted or evicted. + :paramtype daemonset_eviction_for_empty_nodes: bool + :keyword daemonset_eviction_for_occupied_nodes: If set to true, all daemonset pods on occupied + nodes will be evicted before deletion of the node. If the daemonset pod cannot be evicted + another node will be chosen for scaling. If set to false, the node will be deleted without + ensuring that daemonset pods are deleted or evicted. + :paramtype daemonset_eviction_for_occupied_nodes: bool + :keyword ignore_daemonsets_utilization: If set to true, the resources used by daemonset will be + taken into account when making scaling down decisions. + :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.v2024_04_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. + :paramtype max_graceful_termination_sec: str + :keyword max_node_provision_time: The default is '15m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype max_node_provision_time: str + :keyword max_total_unready_percentage: The default is 45. The maximum is 100 and the minimum is + 0. + :paramtype max_total_unready_percentage: str + :keyword new_pod_scale_up_delay: For scenarios like burst/batch scale where you don't want CA + to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + unscheduled pods before they're a certain age. The default is '0s'. Values must be an integer + followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + :paramtype new_pod_scale_up_delay: str + :keyword ok_total_unready_count: This must be an integer. The default is 3. + :paramtype ok_total_unready_count: str + :keyword scan_interval: The default is '10'. Values must be an integer number of seconds. + :paramtype scan_interval: str + :keyword scale_down_delay_after_add: The default is '10m'. Values must be an integer followed + by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_add: str + :keyword scale_down_delay_after_delete: The default is the scan-interval. Values must be an + integer followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_delete: str + :keyword scale_down_delay_after_failure: The default is '3m'. Values must be an integer + followed by an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_delay_after_failure: str + :keyword scale_down_unneeded_time: The default is '10m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unneeded_time: str + :keyword scale_down_unready_time: The default is '20m'. Values must be an integer followed by + an 'm'. No unit of time other than minutes (m) is supported. + :paramtype scale_down_unready_time: str + :keyword scale_down_utilization_threshold: The default is '0.5'. + :paramtype scale_down_utilization_threshold: str + :keyword skip_nodes_with_local_storage: The default is true. + :paramtype skip_nodes_with_local_storage: str + :keyword skip_nodes_with_system_pods: The default is true. + :paramtype skip_nodes_with_system_pods: str + """ + super().__init__(**kwargs) + self.balance_similar_node_groups = balance_similar_node_groups + self.daemonset_eviction_for_empty_nodes = daemonset_eviction_for_empty_nodes + self.daemonset_eviction_for_occupied_nodes = daemonset_eviction_for_occupied_nodes + self.ignore_daemonsets_utilization = ignore_daemonsets_utilization + self.expander = expander + self.max_empty_bulk_delete = max_empty_bulk_delete + self.max_graceful_termination_sec = max_graceful_termination_sec + self.max_node_provision_time = max_node_provision_time + self.max_total_unready_percentage = max_total_unready_percentage + self.new_pod_scale_up_delay = new_pod_scale_up_delay + self.ok_total_unready_count = ok_total_unready_count + self.scan_interval = scan_interval + self.scale_down_delay_after_add = scale_down_delay_after_add + self.scale_down_delay_after_delete = scale_down_delay_after_delete + self.scale_down_delay_after_failure = scale_down_delay_after_failure + self.scale_down_unneeded_time = scale_down_unneeded_time + self.scale_down_unready_time = scale_down_unready_time + self.scale_down_utilization_threshold = scale_down_utilization_threshold + self.skip_nodes_with_local_storage = skip_nodes_with_local_storage + self.skip_nodes_with_system_pods = skip_nodes_with_system_pods + + +class ManagedClusterPropertiesForSnapshot(_serialization.Model): + """managed cluster properties for snapshot, these properties are read only. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kubernetes_version: The current kubernetes version. + :vartype kubernetes_version: str + :ivar sku: The current managed cluster sku. + :vartype sku: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.NetworkProfileForSnapshot + """ + + _validation = { + "network_profile": {"readonly": True}, + } + + _attribute_map = { + "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, + "sku": {"key": "sku", "type": "ManagedClusterSKU"}, + "enable_rbac": {"key": "enableRbac", "type": "bool"}, + "network_profile": {"key": "networkProfile", "type": "NetworkProfileForSnapshot"}, + } + + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + sku: Optional["_models.ManagedClusterSKU"] = None, + enable_rbac: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword kubernetes_version: The current kubernetes version. + :paramtype kubernetes_version: str + :keyword sku: The current managed cluster sku. + :paramtype sku: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSKU + :keyword enable_rbac: Whether the cluster has enabled Kubernetes Role-Based Access Control or + not. + :paramtype enable_rbac: bool + """ + super().__init__(**kwargs) + self.kubernetes_version = kubernetes_version + self.sku = sku + self.enable_rbac = enable_rbac + self.network_profile = None + + +class ManagedClusterSecurityProfile(_serialization.Model): + """Security profile for the container service cluster. + + :ivar defender: Microsoft Defender settings for the security profile. + :vartype defender: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + :ivar image_cleaner: Image Cleaner settings for the security profile. + :vartype image_cleaner: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSecurityProfileImageIntegrity + :ivar node_restriction: `Node Restriction + `_ + settings for the security profile. + :vartype node_restriction: + ~azure.mgmt.containerservice.v2024_04_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 nodes with the Custom CA Trust feature enabled. For more information see + `Custom CA Trust Certificates + `_. + :vartype custom_ca_trust_certificates: list[bytes] + """ + + _validation = { + "custom_ca_trust_certificates": {"max_items": 10, "min_items": 0}, + } + + _attribute_map = { + "defender": {"key": "defender", "type": "ManagedClusterSecurityProfileDefender"}, + "azure_key_vault_kms": {"key": "azureKeyVaultKms", "type": "AzureKeyVaultKms"}, + "workload_identity": {"key": "workloadIdentity", "type": "ManagedClusterSecurityProfileWorkloadIdentity"}, + "image_cleaner": {"key": "imageCleaner", "type": "ManagedClusterSecurityProfileImageCleaner"}, + "image_integrity": {"key": "imageIntegrity", "type": "ManagedClusterSecurityProfileImageIntegrity"}, + "node_restriction": {"key": "nodeRestriction", "type": "ManagedClusterSecurityProfileNodeRestriction"}, + "custom_ca_trust_certificates": {"key": "customCATrustCertificates", "type": "[bytearray]"}, + } + + def __init__( + self, + *, + defender: Optional["_models.ManagedClusterSecurityProfileDefender"] = None, + azure_key_vault_kms: Optional["_models.AzureKeyVaultKms"] = None, + workload_identity: Optional["_models.ManagedClusterSecurityProfileWorkloadIdentity"] = None, + image_cleaner: Optional["_models.ManagedClusterSecurityProfileImageCleaner"] = None, + image_integrity: Optional["_models.ManagedClusterSecurityProfileImageIntegrity"] = None, + node_restriction: Optional["_models.ManagedClusterSecurityProfileNodeRestriction"] = None, + custom_ca_trust_certificates: Optional[List[bytes]] = None, + **kwargs: Any + ) -> None: + """ + :keyword defender: Microsoft Defender settings for the security profile. + :paramtype defender: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + :keyword image_cleaner: Image Cleaner settings for the security profile. + :paramtype image_cleaner: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSecurityProfileImageIntegrity + :keyword node_restriction: `Node Restriction + `_ + settings for the security profile. + :paramtype node_restriction: + ~azure.mgmt.containerservice.v2024_04_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 nodes with the Custom CA Trust feature enabled. For more information see + `Custom CA Trust Certificates + `_. + :paramtype custom_ca_trust_certificates: list[bytes] + """ + super().__init__(**kwargs) + self.defender = defender + self.azure_key_vault_kms = azure_key_vault_kms + self.workload_identity = workload_identity + self.image_cleaner = image_cleaner + self.image_integrity = image_integrity + self.node_restriction = node_restriction + self.custom_ca_trust_certificates = custom_ca_trust_certificates + + +class ManagedClusterSecurityProfileDefender(_serialization.Model): + """Microsoft Defender settings for the security profile. + + :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required + and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + empty. + :vartype log_analytics_workspace_resource_id: str + :ivar security_monitoring: Microsoft Defender threat detection for Cloud settings for the + security profile. + :vartype security_monitoring: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + """ + + _attribute_map = { + "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, + "security_monitoring": { + "key": "securityMonitoring", + "type": "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + }, + } + + def __init__( + self, + *, + log_analytics_workspace_resource_id: Optional[str] = None, + security_monitoring: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityMonitoring"] = None, + **kwargs: Any + ) -> None: + """ + :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be + associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required + and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field + empty. + :paramtype log_analytics_workspace_resource_id: str + :keyword security_monitoring: Microsoft Defender threat detection for Cloud settings for the + security profile. + :paramtype security_monitoring: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + """ + super().__init__(**kwargs) + self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id + self.security_monitoring = security_monitoring + + +class ManagedClusterSecurityProfileDefenderSecurityMonitoring(_serialization.Model): # pylint: disable=name-too-long + """Microsoft Defender settings for the security profile threat detection. + + :ivar enabled: Whether to enable Defender threat detection. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Defender threat detection. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileImageCleaner(_serialization.Model): # pylint: disable=name-too-long + """Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce + attack surface area. Here are settings for the security profile. + + :ivar enabled: Whether to enable Image Cleaner on AKS cluster. + :vartype enabled: bool + :ivar interval_hours: Image Cleaner scanning interval in hours. + :vartype interval_hours: int + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "interval_hours": {"key": "intervalHours", "type": "int"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, interval_hours: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Image Cleaner on AKS cluster. + :paramtype enabled: bool + :keyword interval_hours: Image Cleaner scanning interval in hours. + :paramtype interval_hours: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.interval_hours = interval_hours + + +class ManagedClusterSecurityProfileImageIntegrity(_serialization.Model): # pylint: disable=name-too-long + """Image integrity related settings for the security profile. + + :ivar enabled: Whether to enable image integrity. The default value is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable image integrity. The default value is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileNodeRestriction(_serialization.Model): # pylint: disable=name-too-long + """Node Restriction settings for the security profile. + + :ivar enabled: Whether to enable Node Restriction. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Node Restriction. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileWorkloadIdentity(_serialization.Model): # pylint: disable=name-too-long + """Workload identity settings for the security profile. + + :ivar enabled: Whether to enable workload identity. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable workload identity. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterServicePrincipalProfile(_serialization.Model): + """Information about a service principal identity for the cluster to use for manipulating Azure + APIs. + + All required parameters must be populated in order to send to server. + + :ivar client_id: The ID for the service principal. Required. + :vartype client_id: str + :ivar secret: The secret password associated with the service principal in plain text. + :vartype secret: str + """ + + _validation = { + "client_id": {"required": True}, + } + + _attribute_map = { + "client_id": {"key": "clientId", "type": "str"}, + "secret": {"key": "secret", "type": "str"}, + } + + def __init__(self, *, client_id: str, secret: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword client_id: The ID for the service principal. Required. + :paramtype client_id: str + :keyword secret: The secret password associated with the service principal in plain text. + :paramtype secret: str + """ + super().__init__(**kwargs) + self.client_id = client_id + self.secret = secret + + +class ManagedClusterSKU(_serialization.Model): + """The SKU of a Managed Cluster. + + :ivar name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". + :vartype name: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSKUTier + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "_models.ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "_models.ManagedClusterSKUTier"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". + :paramtype name: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSKUTier + """ + super().__init__(**kwargs) + self.name = name + self.tier = tier + + +class ManagedClusterSnapshot(TrackedResource): + """A managed cluster snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.ManagedClusterPropertiesForSnapshot + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "managed_cluster_properties_read_only": {"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}"}, + "location": {"key": "location", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "snapshot_type": {"key": "properties.snapshotType", "type": "str"}, + "managed_cluster_properties_read_only": { + "key": "properties.managedClusterPropertiesReadOnly", + "type": "ManagedClusterPropertiesForSnapshot", + }, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["_models.CreationData"] = None, + snapshot_type: Union[str, "_models.SnapshotType"] = "NodePool", + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :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.v2024_04_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.v2024_04_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 + + +class ManagedClusterSnapshotListResult(_serialization.Model): + """The response from the List Managed Cluster Snapshots operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The list of managed cluster snapshots. + :vartype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot] + :ivar next_link: The URL to get the next set of managed cluster snapshot results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[ManagedClusterSnapshot]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.ManagedClusterSnapshot"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of managed cluster snapshots. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class ManagedClusterStaticEgressGatewayProfile(_serialization.Model): + """The Static Egress Gateway addon configuration for the cluster. + + :ivar enabled: Indicates if Static Egress Gateway addon is enabled or not. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Indicates if Static Egress Gateway addon is enabled or not. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfile(_serialization.Model): + """Storage profile for the container service cluster. + + :ivar disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. + :vartype disk_csi_driver: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + :ivar file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :vartype file_csi_driver: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + :ivar snapshot_controller: Snapshot Controller settings for the storage profile. + :vartype snapshot_controller: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfileSnapshotController + :ivar blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :vartype blob_csi_driver: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver + """ + + _attribute_map = { + "disk_csi_driver": {"key": "diskCSIDriver", "type": "ManagedClusterStorageProfileDiskCSIDriver"}, + "file_csi_driver": {"key": "fileCSIDriver", "type": "ManagedClusterStorageProfileFileCSIDriver"}, + "snapshot_controller": {"key": "snapshotController", "type": "ManagedClusterStorageProfileSnapshotController"}, + "blob_csi_driver": {"key": "blobCSIDriver", "type": "ManagedClusterStorageProfileBlobCSIDriver"}, + } + + def __init__( + self, + *, + disk_csi_driver: Optional["_models.ManagedClusterStorageProfileDiskCSIDriver"] = None, + file_csi_driver: Optional["_models.ManagedClusterStorageProfileFileCSIDriver"] = None, + snapshot_controller: Optional["_models.ManagedClusterStorageProfileSnapshotController"] = None, + blob_csi_driver: Optional["_models.ManagedClusterStorageProfileBlobCSIDriver"] = None, + **kwargs: Any + ) -> None: + """ + :keyword disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. + :paramtype disk_csi_driver: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + :keyword file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :paramtype file_csi_driver: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + :keyword snapshot_controller: Snapshot Controller settings for the storage profile. + :paramtype snapshot_controller: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfileSnapshotController + :keyword blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :paramtype blob_csi_driver: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterStorageProfileBlobCSIDriver + """ + super().__init__(**kwargs) + self.disk_csi_driver = disk_csi_driver + self.file_csi_driver = file_csi_driver + self.snapshot_controller = snapshot_controller + self.blob_csi_driver = blob_csi_driver + + +class ManagedClusterStorageProfileBlobCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureBlob CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureBlob CSI Driver. The default value is false. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureBlob CSI Driver. The default value is false. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfileDiskCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureDisk CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureDisk CSI Driver. The default value is true. + :vartype enabled: bool + :ivar version: The version of AzureDisk CSI Driver. The default value is v1. + :vartype version: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "version": {"key": "version", "type": "str"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, version: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureDisk CSI Driver. The default value is true. + :paramtype enabled: bool + :keyword version: The version of AzureDisk CSI Driver. The default value is v1. + :paramtype version: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.version = version + + +class ManagedClusterStorageProfileFileCSIDriver(_serialization.Model): # pylint: disable=name-too-long + """AzureFile CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureFile CSI Driver. The default value is true. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable AzureFile CSI Driver. The default value is true. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterStorageProfileSnapshotController(_serialization.Model): # pylint: disable=name-too-long + """Snapshot Controller settings for the storage profile. + + :ivar enabled: Whether to enable Snapshot Controller. The default value is true. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable Snapshot Controller. The default value is true. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterUpgradeProfile(_serialization.Model): + """The list of available upgrades for compute pools. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the upgrade profile. + :vartype id: str + :ivar name: The name of the upgrade profile. + :vartype name: str + :ivar type: The type of the upgrade profile. + :vartype type: str + :ivar control_plane_profile: The list of available upgrade versions for the control plane. + Required. + :vartype control_plane_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterPoolUpgradeProfile] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "control_plane_profile": {"required": True}, + "agent_pool_profiles": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "control_plane_profile": {"key": "properties.controlPlaneProfile", "type": "ManagedClusterPoolUpgradeProfile"}, + "agent_pool_profiles": {"key": "properties.agentPoolProfiles", "type": "[ManagedClusterPoolUpgradeProfile]"}, + } + + def __init__( + self, + *, + control_plane_profile: "_models.ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: List["_models.ManagedClusterPoolUpgradeProfile"], + **kwargs: Any + ) -> None: + """ + :keyword control_plane_profile: The list of available upgrade versions for the control plane. + Required. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterPoolUpgradeProfile] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.control_plane_profile = control_plane_profile + self.agent_pool_profiles = agent_pool_profiles + + +class ManagedClusterWindowsProfile(_serialization.Model): + """Profile for Windows VMs in the managed cluster. + + All required parameters must be populated in order to send to server. + + :ivar admin_username: Specifies the name of the administrator account. :code:`
`:code:`
` + **Restriction:** Cannot end in "." :code:`
`:code:`
` **Disallowed values:** + "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", + "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", + "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 character + :code:`
`:code:`
` **Max-length:** 20 characters. Required. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :vartype admin_password: str + :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.v2024_04_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.v2024_04_02_preview.models.WindowsGmsaProfile + """ + + _validation = { + "admin_username": {"required": True}, + } + + _attribute_map = { + "admin_username": {"key": "adminUsername", "type": "str"}, + "admin_password": {"key": "adminPassword", "type": "str"}, + "license_type": {"key": "licenseType", "type": "str"}, + "enable_csi_proxy": {"key": "enableCSIProxy", "type": "bool"}, + "gmsa_profile": {"key": "gmsaProfile", "type": "WindowsGmsaProfile"}, + } + + def __init__( + self, + *, + admin_username: str, + admin_password: Optional[str] = None, + license_type: Optional[Union[str, "_models.LicenseType"]] = None, + enable_csi_proxy: Optional[bool] = None, + gmsa_profile: Optional["_models.WindowsGmsaProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword admin_username: Specifies the name of the administrator account. + :code:`
`:code:`
` **Restriction:** Cannot end in "." :code:`
`:code:`
` + **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", + "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", + "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + "sys", "test2", "test3", "user4", "user5". :code:`
`:code:`
` **Minimum-length:** 1 + character :code:`
`:code:`
` **Max-length:** 20 characters. Required. + :paramtype admin_username: str + :keyword admin_password: Specifies the password of the administrator account. + :code:`
`:code:`
` **Minimum-length:** 8 characters :code:`
`:code:`
` + **Max-length:** 123 characters :code:`
`:code:`
` **Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper + characters :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) + :code:`
`:code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + :paramtype admin_password: str + :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.v2024_04_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.v2024_04_02_preview.models.WindowsGmsaProfile + """ + super().__init__(**kwargs) + self.admin_username = admin_username + self.admin_password = admin_password + self.license_type = license_type + self.enable_csi_proxy = enable_csi_proxy + self.gmsa_profile = gmsa_profile + + +class ManagedClusterWorkloadAutoScalerProfile(_serialization.Model): + """Workload Auto-scaler profile for the managed cluster. + + :ivar keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :vartype keda: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + :ivar vertical_pod_autoscaler: + :vartype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler # pylint: disable=line-too-long + """ + + _attribute_map = { + "keda": {"key": "keda", "type": "ManagedClusterWorkloadAutoScalerProfileKeda"}, + "vertical_pod_autoscaler": { + "key": "verticalPodAutoscaler", + "type": "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + }, + } + + def __init__( + self, + *, + keda: Optional["_models.ManagedClusterWorkloadAutoScalerProfileKeda"] = None, + vertical_pod_autoscaler: Optional[ + "_models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler" + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :paramtype keda: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + :keyword vertical_pod_autoscaler: + :paramtype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler # pylint: disable=line-too-long + """ + super().__init__(**kwargs) + self.keda = keda + self.vertical_pod_autoscaler = vertical_pod_autoscaler + + +class ManagedClusterWorkloadAutoScalerProfileKeda(_serialization.Model): # pylint: disable=name-too-long + """KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable KEDA. Required. + :vartype enabled: bool + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: bool, **kwargs: Any) -> None: + """ + :keyword enabled: Whether to enable KEDA. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler( + _serialization.Model +): # pylint: disable=name-too-long + """ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. + + All required parameters must be populated in order to send to server. + + :ivar enabled: Whether to enable VPA add-on in cluster. Default value is false. Required. + :vartype enabled: bool + :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.v2024_04_02_preview.models.AddonAutoscaling + """ + + _validation = { + "enabled": {"required": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "addon_autoscaling": {"key": "addonAutoscaling", "type": "str"}, + } + + def __init__( + self, + *, + enabled: bool = False, + addon_autoscaling: Union[str, "_models.AddonAutoscaling"] = "Disabled", + **kwargs: Any + ) -> None: + """ + :keyword enabled: Whether to enable VPA add-on in cluster. Default value is false. Required. + :paramtype enabled: bool + :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.v2024_04_02_preview.models.AddonAutoscaling + """ + super().__init__(**kwargs) + self.enabled = enabled + self.addon_autoscaling = addon_autoscaling + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(_serialization.Model): # pylint: disable=name-too-long + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class 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 count: Number of nodes. + :vartype count: int + """ + + _attribute_map = { + "sizes": {"key": "sizes", "type": "[str]"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, sizes: Optional[List[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 count: Number of nodes. + :paramtype count: int + """ + super().__init__(**kwargs) + self.sizes = sizes + self.count = count + + +class MeshRevision(_serialization.Model): + """Holds information on upgrades and compatibility for given major.minor mesh release. + + :ivar revision: The revision of the mesh release. + :vartype revision: str + :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. + :vartype upgrades: list[str] + :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.v2024_04_02_preview.models.CompatibleVersions] + """ + + _attribute_map = { + "revision": {"key": "revision", "type": "str"}, + "upgrades": {"key": "upgrades", "type": "[str]"}, + "compatible_with": {"key": "compatibleWith", "type": "[CompatibleVersions]"}, + } + + def __init__( + self, + *, + revision: Optional[str] = None, + upgrades: Optional[List[str]] = None, + compatible_with: Optional[List["_models.CompatibleVersions"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword revision: The revision of the mesh release. + :paramtype revision: str + :keyword upgrades: List of revisions available for upgrade of a specific mesh revision. + :paramtype upgrades: list[str] + :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.v2024_04_02_preview.models.CompatibleVersions] + """ + super().__init__(**kwargs) + self.revision = revision + self.upgrades = upgrades + self.compatible_with = compatible_with + + +class MeshRevisionProfile(ProxyResource): + """Mesh revision profile for a mesh. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SystemData + :ivar properties: Mesh revision profile properties for a mesh. + :vartype properties: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshRevisionProfileProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "properties": {"key": "properties", "type": "MeshRevisionProfileProperties"}, + } + + def __init__(self, *, properties: Optional["_models.MeshRevisionProfileProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Mesh revision profile properties for a mesh. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshRevisionProfileProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class MeshRevisionProfileList(_serialization.Model): + """Holds an array of MeshRevisionsProfiles. + + 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.v2024_04_02_preview.models.MeshRevisionProfile] + :ivar next_link: The URL to get the next set of mesh revision profile. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MeshRevisionProfile]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_04_02_preview.models.MeshRevisionProfile] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MeshRevisionProfileProperties(_serialization.Model): + """Mesh revision profile properties for a mesh. + + :ivar mesh_revisions: + :vartype mesh_revisions: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshRevision] + """ + + _attribute_map = { + "mesh_revisions": {"key": "meshRevisions", "type": "[MeshRevision]"}, + } + + def __init__(self, *, mesh_revisions: Optional[List["_models.MeshRevision"]] = None, **kwargs: Any) -> None: + """ + :keyword mesh_revisions: + :paramtype mesh_revisions: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshRevision] + """ + super().__init__(**kwargs) + self.mesh_revisions = mesh_revisions + + +class MeshUpgradeProfile(ProxyResource): + """Upgrade profile for given mesh. + + 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SystemData + :ivar properties: Mesh upgrade profile properties for a major.minor release. + :vartype properties: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshUpgradeProfileProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"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"}, + "properties": {"key": "properties", "type": "MeshUpgradeProfileProperties"}, + } + + def __init__(self, *, properties: Optional["_models.MeshUpgradeProfileProperties"] = None, **kwargs: Any) -> None: + """ + :keyword properties: Mesh upgrade profile properties for a major.minor release. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshUpgradeProfileProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class MeshUpgradeProfileList(_serialization.Model): + """Holds an array of MeshUpgradeProfiles. + + 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.v2024_04_02_preview.models.MeshUpgradeProfile] + :ivar next_link: The URL to get the next set of mesh upgrade profile. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[MeshUpgradeProfile]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + 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.v2024_04_02_preview.models.MeshUpgradeProfile] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class MeshUpgradeProfileProperties(MeshRevision): + """Mesh upgrade profile properties for a major.minor release. + + :ivar revision: The revision of the mesh release. + :vartype revision: str + :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. + :vartype upgrades: list[str] + :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.v2024_04_02_preview.models.CompatibleVersions] + """ + + +class NetworkMonitoring(_serialization.Model): + """This addon can be used to configure network monitoring and generate network monitoring data in + Prometheus format. + + :ivar enabled: Enable or disable the network monitoring plugin on the cluster. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Enable or disable the network monitoring plugin on the cluster. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +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.v2024_04_02_preview.models.NetworkPlugin + :ivar network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" + :vartype network_plugin_mode: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.LoadBalancerSku + """ + + _attribute_map = { + "network_plugin": {"key": "networkPlugin", "type": "str"}, + "network_plugin_mode": {"key": "networkPluginMode", "type": "str"}, + "network_policy": {"key": "networkPolicy", "type": "str"}, + "network_mode": {"key": "networkMode", "type": "str"}, + "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, + } + + def __init__( + self, + *, + network_plugin: Union[str, "_models.NetworkPlugin"] = "kubenet", + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_plugin: networkPlugin for managed cluster snapshot. Known values are: "azure", + "kubenet", and "none". + :paramtype network_plugin: str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.NetworkPlugin + :keyword network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" + :paramtype network_plugin_mode: str or + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.LoadBalancerSku + """ + super().__init__(**kwargs) + self.network_plugin = network_plugin + self.network_plugin_mode = network_plugin_mode + self.network_policy = network_policy + self.network_mode = network_mode + self.load_balancer_sku = load_balancer_sku + + +class OperationListResult(_serialization.Model): + """The List Operation response. + + 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.v2024_04_02_preview.models.OperationValue] + """ + + _validation = { + "value": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OperationValue]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + + +class OperationStatusResult(_serialization.Model): + """The current status of an async operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ErrorDetail + """ + + _validation = { + "resource_id": {"readonly": True}, + "status": {"required": True}, + "percent_complete": {"maximum": 100, "minimum": 0}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "resource_id": {"key": "resourceId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "percent_complete": {"key": "percentComplete", "type": "float"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "operations": {"key": "operations", "type": "[OperationStatusResult]"}, + "error": {"key": "error", "type": "ErrorDetail"}, + } + + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[List["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Fully qualified ID for the async operation. + :paramtype id: str + :keyword name: Name of the async operation. + :paramtype name: str + :keyword status: Operation status. Required. + :paramtype status: str + :keyword percent_complete: Percent of the operation that is complete. + :paramtype percent_complete: float + :keyword start_time: The start time of the operation. + :paramtype start_time: ~datetime.datetime + :keyword end_time: The end time of the operation. + :paramtype end_time: ~datetime.datetime + :keyword operations: The operations list. + :paramtype operations: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.OperationStatusResult] + :keyword error: If present, details of the operation error. + :paramtype error: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ErrorDetail + """ + super().__init__(**kwargs) + self.id = id + self.resource_id = None + self.name = name + self.status = status + self.percent_complete = percent_complete + self.start_time = start_time + self.end_time = end_time + self.operations = operations + self.error = error + + +class OperationStatusResultList(_serialization.Model): + """The operations list. It contains an URL link to get the next set of results. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of operations. + :vartype value: + list[~azure.mgmt.containerservice.v2024_04_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 + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OperationStatusResult]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class OperationValue(_serialization.Model): + """Describes the properties of a Operation value. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + _validation = { + "origin": {"readonly": True}, + "name": {"readonly": True}, + "operation": {"readonly": True}, + "resource": {"readonly": True}, + "description": {"readonly": True}, + "provider": {"readonly": True}, + } + + _attribute_map = { + "origin": {"key": "origin", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "operation": {"key": "display.operation", "type": "str"}, + "resource": {"key": "display.resource", "type": "str"}, + "description": {"key": "display.description", "type": "str"}, + "provider": {"key": "display.provider", "type": "str"}, + } + + 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 + + +class OSOptionProfile(_serialization.Model): + """The OS option profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: The ID of the OS option resource. + :vartype id: str + :ivar name: The name of the OS option resource. + :vartype name: str + :ivar type: The type of the OS option resource. + :vartype type: str + :ivar os_option_property_list: The list of OS options. Required. + :vartype os_option_property_list: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.OSOptionProperty] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "os_option_property_list": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "os_option_property_list": {"key": "properties.osOptionPropertyList", "type": "[OSOptionProperty]"}, + } + + def __init__(self, *, os_option_property_list: List["_models.OSOptionProperty"], **kwargs: Any) -> None: + """ + :keyword os_option_property_list: The list of OS options. Required. + :paramtype os_option_property_list: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.OSOptionProperty] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.os_option_property_list = os_option_property_list + + +class OSOptionProperty(_serialization.Model): + """OS option property. + + All required parameters must be populated in order to send to server. + + :ivar os_type: The OS type. Required. + :vartype os_type: str + :ivar enable_fips_image: Whether the image is FIPS-enabled. Required. + :vartype enable_fips_image: bool + """ + + _validation = { + "os_type": {"required": True}, + "enable_fips_image": {"required": True}, + } + + _attribute_map = { + "os_type": {"key": "os-type", "type": "str"}, + "enable_fips_image": {"key": "enable-fips-image", "type": "bool"}, + } + + def __init__(self, *, os_type: str, enable_fips_image: bool, **kwargs: Any) -> None: + """ + :keyword os_type: The OS type. Required. + :paramtype os_type: str + :keyword enable_fips_image: Whether the image is FIPS-enabled. Required. + :paramtype enable_fips_image: bool + """ + super().__init__(**kwargs) + self.os_type = os_type + self.enable_fips_image = enable_fips_image + + +class OutboundEnvironmentEndpoint(_serialization.Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.EndpointDependency] + """ + + _attribute_map = { + "category": {"key": "category", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[EndpointDependency]"}, + } + + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[List["_models.EndpointDependency"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :paramtype category: str + :keyword endpoints: The endpoints that AKS agent nodes connect to. + :paramtype endpoints: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.EndpointDependency] + """ + super().__init__(**kwargs) + self.category = category + self.endpoints = endpoints + + +class OutboundEnvironmentEndpointCollection(_serialization.Model): + """Collection of OutboundEnvironmentEndpoint. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.OutboundEnvironmentEndpoint] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[OutboundEnvironmentEndpoint]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.OutboundEnvironmentEndpoint"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.OutboundEnvironmentEndpoint] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class PortRange(_serialization.Model): + """The port range. + + :ivar port_start: The minimum port that is included in the range. It should be ranged from 1 to + 65535, and be less than or equal to portEnd. + :vartype port_start: int + :ivar port_end: The maximum port that is included in the range. It should be ranged from 1 to + 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.v2024_04_02_preview.models.Protocol + """ + + _validation = { + "port_start": {"maximum": 65535, "minimum": 1}, + "port_end": {"maximum": 65535, "minimum": 1}, + } + + _attribute_map = { + "port_start": {"key": "portStart", "type": "int"}, + "port_end": {"key": "portEnd", "type": "int"}, + "protocol": {"key": "protocol", "type": "str"}, + } + + def __init__( + self, + *, + port_start: Optional[int] = None, + port_end: Optional[int] = None, + protocol: Optional[Union[str, "_models.Protocol"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword port_start: The minimum port that is included in the range. It should be ranged from 1 + to 65535, and be less than or equal to portEnd. + :paramtype port_start: int + :keyword port_end: The maximum port that is included in the range. It should be ranged from 1 + 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.v2024_04_02_preview.models.Protocol + """ + super().__init__(**kwargs) + self.port_start = port_start + self.port_end = port_end + self.protocol = protocol + + +class PowerState(_serialization.Model): + """Describes the Power State of the cluster. + + :ivar code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and + "Stopped". + :vartype code: str or ~azure.mgmt.containerservice.v2024_04_02_preview.models.Code + """ + + _attribute_map = { + "code": {"key": "code", "type": "str"}, + } + + def __init__(self, *, code: Optional[Union[str, "_models.Code"]] = None, **kwargs: Any) -> None: + """ + :keyword code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and + "Stopped". + :paramtype code: str or ~azure.mgmt.containerservice.v2024_04_02_preview.models.Code + """ + super().__init__(**kwargs) + self.code = code + + +class PrivateEndpoint(_serialization.Model): + """Private endpoint which a connection belongs to. + + :ivar id: The resource ID of the private endpoint. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The resource ID of the private endpoint. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class PrivateEndpointConnection(_serialization.Model): + """A private endpoint connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private endpoint connection. + :vartype id: str + :ivar name: The name of the private endpoint connection. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar provisioning_state: The current provisioning state. Known values are: "Canceled", + "Creating", "Deleting", "Failed", and "Succeeded". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnectionProvisioningState + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.PrivateLinkServiceConnectionState + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, + } + + def __init__( + self, + *, + private_endpoint: Optional["_models.PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, + **kwargs: Any + ) -> None: + """ + :keyword private_endpoint: The resource of private endpoint. + :paramtype private_endpoint: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.PrivateLinkServiceConnectionState + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.provisioning_state = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + + +class PrivateEndpointConnectionListResult(_serialization.Model): + """A list of private endpoint connections. + + :ivar value: The collection value. + :vartype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnection] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnection] + """ + super().__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(_serialization.Model): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + _validation = { + "private_link_service_id": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "group_id": {"key": "groupId", "type": "str"}, + "required_members": {"key": "requiredMembers", "type": "[str]"}, + "private_link_service_id": {"key": "privateLinkServiceID", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: The ID of the private link resource. + :paramtype id: str + :keyword name: The name of the private link resource. + :paramtype name: str + :keyword type: The resource type. + :paramtype type: str + :keyword group_id: The group ID of the resource. + :paramtype group_id: str + :keyword required_members: The RequiredMembers of the resource. + :paramtype required_members: list[str] + """ + super().__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.group_id = group_id + self.required_members = required_members + self.private_link_service_id = None + + +class PrivateLinkResourcesListResult(_serialization.Model): + """A list of private link resources. + + :ivar value: The collection value. + :vartype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateLinkResource] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[PrivateLinkResource]"}, + } + + def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The collection value. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateLinkResource] + """ + super().__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(_serialization.Model): + """The state of a private link service connection. + + :ivar status: The private link service connection status. Known values are: "Pending", + "Approved", "Rejected", and "Disconnected". + :vartype status: str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str + """ + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "_models.ConnectionStatus"]] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword status: The private link service connection status. Known values are: "Pending", + "Approved", "Rejected", and "Disconnected". + :paramtype status: str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.ConnectionStatus + :keyword description: The private link service connection description. + :paramtype description: str + """ + super().__init__(**kwargs) + self.status = status + self.description = description + + +class RebalanceLoadBalancersRequestBody(_serialization.Model): + """The names of the load balancers to rebalance. If set to empty, all load balancers will be + rebalanced. + + :ivar load_balancer_names: The load balancer names list. + :vartype load_balancer_names: list[str] + """ + + _attribute_map = { + "load_balancer_names": {"key": "loadBalancerNames", "type": "[str]"}, + } + + def __init__(self, *, load_balancer_names: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword load_balancer_names: The load balancer names list. + :paramtype load_balancer_names: list[str] + """ + super().__init__(**kwargs) + self.load_balancer_names = load_balancer_names + + +class RelativeMonthlySchedule(_serialization.Model): + """For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last + Friday'. + + All required parameters must be populated in order to send to server. + + :ivar interval_months: Specifies the number of months between each set of occurrences. + Required. + :vartype interval_months: int + :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.v2024_04_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.v2024_04_02_preview.models.WeekDay + """ + + _validation = { + "interval_months": {"required": True, "maximum": 6, "minimum": 1}, + "week_index": {"required": True}, + "day_of_week": {"required": True}, + } + + _attribute_map = { + "interval_months": {"key": "intervalMonths", "type": "int"}, + "week_index": {"key": "weekIndex", "type": "str"}, + "day_of_week": {"key": "dayOfWeek", "type": "str"}, + } + + def __init__( + self, + *, + interval_months: int, + week_index: Union[str, "_models.Type"], + day_of_week: Union[str, "_models.WeekDay"], + **kwargs: Any + ) -> None: + """ + :keyword interval_months: Specifies the number of months between each set of occurrences. + Required. + :paramtype interval_months: int + :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.v2024_04_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.v2024_04_02_preview.models.WeekDay + """ + super().__init__(**kwargs) + self.interval_months = interval_months + self.week_index = week_index + self.day_of_week = day_of_week + + +class ResourceReference(_serialization.Model): + """A reference to an Azure resource. + + :ivar id: The fully qualified Azure resource id. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: The fully qualified Azure resource id. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class RunCommandRequest(_serialization.Model): + """A run command request. + + All required parameters must be populated in order to send to server. + + :ivar command: The command to run. Required. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str + """ + + _validation = { + "command": {"required": True}, + } + + _attribute_map = { + "command": {"key": "command", "type": "str"}, + "context": {"key": "context", "type": "str"}, + "cluster_token": {"key": "clusterToken", "type": "str"}, + } + + def __init__( + self, *, command: str, context: Optional[str] = None, cluster_token: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword command: The command to run. Required. + :paramtype command: str + :keyword context: A base64 encoded zip file containing the files required by the command. + :paramtype context: str + :keyword cluster_token: AuthToken issued for AKS AAD Server App. + :paramtype cluster_token: str + """ + super().__init__(**kwargs) + self.command = command + self.context = context + self.cluster_token = cluster_token + + +class RunCommandResult(_serialization.Model): + """run command result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The command id. + :vartype id: str + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + _validation = { + "id": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "exit_code": {"readonly": True}, + "started_at": {"readonly": True}, + "finished_at": {"readonly": True}, + "logs": {"readonly": True}, + "reason": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "exit_code": {"key": "properties.exitCode", "type": "int"}, + "started_at": {"key": "properties.startedAt", "type": "iso-8601"}, + "finished_at": {"key": "properties.finishedAt", "type": "iso-8601"}, + "logs": {"key": "properties.logs", "type": "str"}, + "reason": {"key": "properties.reason", "type": "str"}, + } + + 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 + + +class SafeguardsAvailableVersion(Resource): + """Available Safeguards Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SystemData + :ivar properties: Whether the version is default or not and support info. Required. + :vartype properties: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.SafeguardsAvailableVersionsProperties + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "SafeguardsAvailableVersionsProperties"}, + } + + def __init__(self, *, properties: "_models.SafeguardsAvailableVersionsProperties", **kwargs: Any) -> None: + """ + :keyword properties: Whether the version is default or not and support info. Required. + :paramtype properties: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.SafeguardsAvailableVersionsProperties + """ + super().__init__(**kwargs) + self.properties = properties + + +class SafeguardsAvailableVersionsList(_serialization.Model): + """Hold values properties, which is array of SafeguardsVersions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of AKS supported Safeguards versions. + :vartype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.SafeguardsAvailableVersion] + :ivar next_link: The URL to get the next Safeguards available version. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[SafeguardsAvailableVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.SafeguardsAvailableVersion"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Array of AKS supported Safeguards versions. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.SafeguardsAvailableVersion] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class SafeguardsAvailableVersionsProperties(_serialization.Model): + """Whether the version is default or not and support info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar is_default_version: + :vartype is_default_version: bool + :ivar support: Whether the version is preview or stable. Known values are: "Preview" and + "Stable". + :vartype support: str or + ~azure.mgmt.containerservice.v2024_04_02_preview.models.SafeguardsSupport + """ + + _validation = { + "is_default_version": {"readonly": True}, + "support": {"readonly": True}, + } + + _attribute_map = { + "is_default_version": {"key": "isDefaultVersion", "type": "bool"}, + "support": {"key": "support", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.is_default_version = None + self.support = None + + +class SafeguardsProfile(_serialization.Model): + """The Safeguards profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar system_excluded_namespaces: List of namespaces specified by AKS to be excluded from + Safeguards. + :vartype system_excluded_namespaces: list[str] + :ivar version: The version of constraints to use. + :vartype version: str + :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.v2024_04_02_preview.models.Level + :ivar excluded_namespaces: List of namespaces excluded from Safeguards checks. + :vartype excluded_namespaces: list[str] + """ + + _validation = { + "system_excluded_namespaces": {"readonly": True}, + "level": {"required": True}, + } + + _attribute_map = { + "system_excluded_namespaces": {"key": "systemExcludedNamespaces", "type": "[str]"}, + "version": {"key": "version", "type": "str"}, + "level": {"key": "level", "type": "str"}, + "excluded_namespaces": {"key": "excludedNamespaces", "type": "[str]"}, + } + + def __init__( + self, + *, + level: Union[str, "_models.Level"], + version: Optional[str] = None, + excluded_namespaces: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword version: The version of constraints to use. + :paramtype version: str + :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.v2024_04_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.version = version + self.level = level + self.excluded_namespaces = excluded_namespaces + + +class ScaleProfile(_serialization.Model): + """Specifications on how to scale a VirtualMachines agent pool. + + :ivar manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. + Currently, at most one ManualScaleProfile is allowed. + :vartype manual: + list[~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.AutoScaleProfile] + """ + + _attribute_map = { + "manual": {"key": "manual", "type": "[ManualScaleProfile]"}, + "autoscale": {"key": "autoscale", "type": "[AutoScaleProfile]"}, + } + + def __init__( + self, + *, + manual: Optional[List["_models.ManualScaleProfile"]] = None, + autoscale: Optional[List["_models.AutoScaleProfile"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. + Currently, at most one ManualScaleProfile is allowed. + :paramtype manual: + list[~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.AutoScaleProfile] + """ + super().__init__(**kwargs) + self.manual = manual + self.autoscale = autoscale + + +class Schedule(_serialization.Model): + """One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', + '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.v2024_04_02_preview.models.DailySchedule + :ivar weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + :vartype weekly: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.RelativeMonthlySchedule + """ + + _attribute_map = { + "daily": {"key": "daily", "type": "DailySchedule"}, + "weekly": {"key": "weekly", "type": "WeeklySchedule"}, + "absolute_monthly": {"key": "absoluteMonthly", "type": "AbsoluteMonthlySchedule"}, + "relative_monthly": {"key": "relativeMonthly", "type": "RelativeMonthlySchedule"}, + } + + def __init__( + self, + *, + daily: Optional["_models.DailySchedule"] = None, + weekly: Optional["_models.WeeklySchedule"] = None, + absolute_monthly: Optional["_models.AbsoluteMonthlySchedule"] = None, + relative_monthly: Optional["_models.RelativeMonthlySchedule"] = None, + **kwargs: Any + ) -> None: + """ + :keyword daily: For schedules like: 'recur every day' or 'recur every 3 days'. + :paramtype daily: ~azure.mgmt.containerservice.v2024_04_02_preview.models.DailySchedule + :keyword weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on + Wednesday'. + :paramtype weekly: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_02_preview.models.RelativeMonthlySchedule + """ + super().__init__(**kwargs) + self.daily = daily + self.weekly = weekly + self.absolute_monthly = absolute_monthly + self.relative_monthly = relative_monthly + + +class ServiceMeshProfile(_serialization.Model): + """Service mesh profile for a managed cluster. + + 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.v2024_04_02_preview.models.ServiceMeshMode + :ivar istio: Istio service mesh configuration. + :vartype istio: ~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioServiceMesh + """ + + _validation = { + "mode": {"required": True}, + } + + _attribute_map = { + "mode": {"key": "mode", "type": "str"}, + "istio": {"key": "istio", "type": "IstioServiceMesh"}, + } + + def __init__( + self, + *, + mode: Union[str, "_models.ServiceMeshMode"], + istio: Optional["_models.IstioServiceMesh"] = None, + **kwargs: Any + ) -> None: + """ + :keyword mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". + :paramtype mode: str or ~azure.mgmt.containerservice.v2024_04_02_preview.models.ServiceMeshMode + :keyword istio: Istio service mesh configuration. + :paramtype istio: ~azure.mgmt.containerservice.v2024_04_02_preview.models.IstioServiceMesh + """ + super().__init__(**kwargs) + self.mode = mode + self.istio = istio + + +class Snapshot(TrackedResource): # pylint: disable=too-many-instance-attributes + """A node pool snapshot resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to 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 + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_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.v2024_04_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. + :vartype enable_fips: bool + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "kubernetes_version": {"readonly": True}, + "node_image_version": {"readonly": True}, + "os_type": {"readonly": True}, + "os_sku": {"readonly": True}, + "vm_size": {"readonly": True}, + "enable_fips": {"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}"}, + "location": {"key": "location", "type": "str"}, + "creation_data": {"key": "properties.creationData", "type": "CreationData"}, + "snapshot_type": {"key": "properties.snapshotType", "type": "str"}, + "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, + "node_image_version": {"key": "properties.nodeImageVersion", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "os_sku": {"key": "properties.osSku", "type": "str"}, + "vm_size": {"key": "properties.vmSize", "type": "str"}, + "enable_fips": {"key": "properties.enableFIPS", "type": "bool"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + creation_data: Optional["_models.CreationData"] = None, + snapshot_type: Union[str, "_models.SnapshotType"] = "NodePool", + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :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.v2024_04_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.v2024_04_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 + + +class SnapshotListResult(_serialization.Model): + """The response from the List Snapshots operation. + + 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.v2024_04_02_preview.models.Snapshot] + :ivar next_link: The URL to get the next set of snapshot results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Snapshot]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.Snapshot"]] = None, **kwargs: Any) -> None: + """ + :keyword value: The list of snapshots. + :paramtype value: list[~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class SysctlConfig(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Sysctl settings for Linux agent nodes. + + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int + """ + + _validation = { + "net_ipv4_tcpkeepalive_intvl": {"maximum": 90, "minimum": 10}, + "net_netfilter_nf_conntrack_max": {"maximum": 2097152, "minimum": 131072}, + "net_netfilter_nf_conntrack_buckets": {"maximum": 524288, "minimum": 65536}, + } + + _attribute_map = { + "net_core_somaxconn": {"key": "netCoreSomaxconn", "type": "int"}, + "net_core_netdev_max_backlog": {"key": "netCoreNetdevMaxBacklog", "type": "int"}, + "net_core_rmem_default": {"key": "netCoreRmemDefault", "type": "int"}, + "net_core_rmem_max": {"key": "netCoreRmemMax", "type": "int"}, + "net_core_wmem_default": {"key": "netCoreWmemDefault", "type": "int"}, + "net_core_wmem_max": {"key": "netCoreWmemMax", "type": "int"}, + "net_core_optmem_max": {"key": "netCoreOptmemMax", "type": "int"}, + "net_ipv4_tcp_max_syn_backlog": {"key": "netIpv4TcpMaxSynBacklog", "type": "int"}, + "net_ipv4_tcp_max_tw_buckets": {"key": "netIpv4TcpMaxTwBuckets", "type": "int"}, + "net_ipv4_tcp_fin_timeout": {"key": "netIpv4TcpFinTimeout", "type": "int"}, + "net_ipv4_tcp_keepalive_time": {"key": "netIpv4TcpKeepaliveTime", "type": "int"}, + "net_ipv4_tcp_keepalive_probes": {"key": "netIpv4TcpKeepaliveProbes", "type": "int"}, + "net_ipv4_tcpkeepalive_intvl": {"key": "netIpv4TcpkeepaliveIntvl", "type": "int"}, + "net_ipv4_tcp_tw_reuse": {"key": "netIpv4TcpTwReuse", "type": "bool"}, + "net_ipv4_ip_local_port_range": {"key": "netIpv4IpLocalPortRange", "type": "str"}, + "net_ipv4_neigh_default_gc_thresh1": {"key": "netIpv4NeighDefaultGcThresh1", "type": "int"}, + "net_ipv4_neigh_default_gc_thresh2": {"key": "netIpv4NeighDefaultGcThresh2", "type": "int"}, + "net_ipv4_neigh_default_gc_thresh3": {"key": "netIpv4NeighDefaultGcThresh3", "type": "int"}, + "net_netfilter_nf_conntrack_max": {"key": "netNetfilterNfConntrackMax", "type": "int"}, + "net_netfilter_nf_conntrack_buckets": {"key": "netNetfilterNfConntrackBuckets", "type": "int"}, + "fs_inotify_max_user_watches": {"key": "fsInotifyMaxUserWatches", "type": "int"}, + "fs_file_max": {"key": "fsFileMax", "type": "int"}, + "fs_aio_max_nr": {"key": "fsAioMaxNr", "type": "int"}, + "fs_nr_open": {"key": "fsNrOpen", "type": "int"}, + "kernel_threads_max": {"key": "kernelThreadsMax", "type": "int"}, + "vm_max_map_count": {"key": "vmMaxMapCount", "type": "int"}, + "vm_swappiness": {"key": "vmSwappiness", "type": "int"}, + "vm_vfs_cache_pressure": {"key": "vmVfsCachePressure", "type": "int"}, + } + + def __init__( # pylint: disable=too-many-locals + self, + *, + net_core_somaxconn: Optional[int] = None, + net_core_netdev_max_backlog: Optional[int] = None, + net_core_rmem_default: Optional[int] = None, + net_core_rmem_max: Optional[int] = None, + net_core_wmem_default: Optional[int] = None, + net_core_wmem_max: Optional[int] = None, + net_core_optmem_max: Optional[int] = None, + net_ipv4_tcp_max_syn_backlog: Optional[int] = None, + net_ipv4_tcp_max_tw_buckets: Optional[int] = None, + net_ipv4_tcp_fin_timeout: Optional[int] = None, + net_ipv4_tcp_keepalive_time: Optional[int] = None, + net_ipv4_tcp_keepalive_probes: Optional[int] = None, + net_ipv4_tcpkeepalive_intvl: Optional[int] = None, + net_ipv4_tcp_tw_reuse: Optional[bool] = None, + net_ipv4_ip_local_port_range: Optional[str] = None, + net_ipv4_neigh_default_gc_thresh1: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh2: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh3: Optional[int] = None, + net_netfilter_nf_conntrack_max: Optional[int] = None, + net_netfilter_nf_conntrack_buckets: Optional[int] = None, + fs_inotify_max_user_watches: Optional[int] = None, + fs_file_max: Optional[int] = None, + fs_aio_max_nr: Optional[int] = None, + fs_nr_open: Optional[int] = None, + kernel_threads_max: Optional[int] = None, + vm_max_map_count: Optional[int] = None, + vm_swappiness: Optional[int] = None, + vm_vfs_cache_pressure: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. + :paramtype net_core_somaxconn: int + :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :paramtype net_core_netdev_max_backlog: int + :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. + :paramtype net_core_rmem_default: int + :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. + :paramtype net_core_rmem_max: int + :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. + :paramtype net_core_wmem_default: int + :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. + :paramtype net_core_wmem_max: int + :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. + :paramtype net_core_optmem_max: int + :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :paramtype net_ipv4_tcp_max_syn_backlog: int + :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :paramtype net_ipv4_tcp_max_tw_buckets: int + :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :paramtype net_ipv4_tcp_fin_timeout: int + :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :paramtype net_ipv4_tcp_keepalive_time: int + :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :paramtype net_ipv4_tcp_keepalive_probes: int + :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :paramtype net_ipv4_tcpkeepalive_intvl: int + :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :paramtype net_ipv4_tcp_tw_reuse: bool + :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :paramtype net_ipv4_ip_local_port_range: str + :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :paramtype net_ipv4_neigh_default_gc_thresh1: int + :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :paramtype net_ipv4_neigh_default_gc_thresh2: int + :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :paramtype net_ipv4_neigh_default_gc_thresh3: int + :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :paramtype net_netfilter_nf_conntrack_max: int + :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :paramtype net_netfilter_nf_conntrack_buckets: int + :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :paramtype fs_inotify_max_user_watches: int + :keyword fs_file_max: Sysctl setting fs.file-max. + :paramtype fs_file_max: int + :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :paramtype fs_aio_max_nr: int + :keyword fs_nr_open: Sysctl setting fs.nr_open. + :paramtype fs_nr_open: int + :keyword kernel_threads_max: Sysctl setting kernel.threads-max. + :paramtype kernel_threads_max: int + :keyword vm_max_map_count: Sysctl setting vm.max_map_count. + :paramtype vm_max_map_count: int + :keyword vm_swappiness: Sysctl setting vm.swappiness. + :paramtype vm_swappiness: int + :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :paramtype vm_vfs_cache_pressure: int + """ + super().__init__(**kwargs) + self.net_core_somaxconn = net_core_somaxconn + self.net_core_netdev_max_backlog = net_core_netdev_max_backlog + self.net_core_rmem_default = net_core_rmem_default + self.net_core_rmem_max = net_core_rmem_max + self.net_core_wmem_default = net_core_wmem_default + self.net_core_wmem_max = net_core_wmem_max + self.net_core_optmem_max = net_core_optmem_max + self.net_ipv4_tcp_max_syn_backlog = net_ipv4_tcp_max_syn_backlog + self.net_ipv4_tcp_max_tw_buckets = net_ipv4_tcp_max_tw_buckets + self.net_ipv4_tcp_fin_timeout = net_ipv4_tcp_fin_timeout + self.net_ipv4_tcp_keepalive_time = net_ipv4_tcp_keepalive_time + self.net_ipv4_tcp_keepalive_probes = net_ipv4_tcp_keepalive_probes + self.net_ipv4_tcpkeepalive_intvl = net_ipv4_tcpkeepalive_intvl + self.net_ipv4_tcp_tw_reuse = net_ipv4_tcp_tw_reuse + self.net_ipv4_ip_local_port_range = net_ipv4_ip_local_port_range + self.net_ipv4_neigh_default_gc_thresh1 = net_ipv4_neigh_default_gc_thresh1 + self.net_ipv4_neigh_default_gc_thresh2 = net_ipv4_neigh_default_gc_thresh2 + self.net_ipv4_neigh_default_gc_thresh3 = net_ipv4_neigh_default_gc_thresh3 + self.net_netfilter_nf_conntrack_max = net_netfilter_nf_conntrack_max + self.net_netfilter_nf_conntrack_buckets = net_netfilter_nf_conntrack_buckets + self.fs_inotify_max_user_watches = fs_inotify_max_user_watches + self.fs_file_max = fs_file_max + self.fs_aio_max_nr = fs_aio_max_nr + self.fs_nr_open = fs_nr_open + self.kernel_threads_max = kernel_threads_max + self.vm_max_map_count = vm_max_map_count + self.vm_swappiness = vm_swappiness + self.vm_vfs_cache_pressure = vm_vfs_cache_pressure + + +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :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.v2024_04_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. + :vartype last_modified_by: str + :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.v2024_04_02_preview.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :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.v2024_04_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. + :paramtype last_modified_by: str + :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.v2024_04_02_preview.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TagsObject(_serialization.Model): + """Tags object for patch operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class TimeInWeek(_serialization.Model): + """Time in a week. + + :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.v2024_04_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. + :vartype hour_slots: list[int] + """ + + _attribute_map = { + "day": {"key": "day", "type": "str"}, + "hour_slots": {"key": "hourSlots", "type": "[int]"}, + } + + def __init__( + self, + *, + day: Optional[Union[str, "_models.WeekDay"]] = None, + hour_slots: Optional[List[int]] = None, + **kwargs: Any + ) -> None: + """ + :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.v2024_04_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. + :paramtype hour_slots: list[int] + """ + super().__init__(**kwargs) + self.day = day + self.hour_slots = hour_slots + + +class TimeSpan(_serialization.Model): + """For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime + """ + + _attribute_map = { + "start": {"key": "start", "type": "iso-8601"}, + "end": {"key": "end", "type": "iso-8601"}, + } + + def __init__( + self, *, start: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """ + :keyword start: The start of a time span. + :paramtype start: ~datetime.datetime + :keyword end: The end of a time span. + :paramtype end: ~datetime.datetime + """ + super().__init__(**kwargs) + self.start = start + self.end = end + + +class TrustedAccessRole(_serialization.Model): + """Trusted access role definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar source_resource_type: Resource type of Azure resource. + :vartype source_resource_type: str + :ivar name: Name of role, name is unique under a source resource type. + :vartype name: str + :ivar rules: List of rules for the role. This maps to 'rules' property of `Kubernetes Cluster + Role + `_. + :vartype rules: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.TrustedAccessRoleRule] + """ + + _validation = { + "source_resource_type": {"readonly": True}, + "name": {"readonly": True}, + "rules": {"readonly": True}, + } + + _attribute_map = { + "source_resource_type": {"key": "sourceResourceType", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "rules": {"key": "rules", "type": "[TrustedAccessRoleRule]"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.source_resource_type = None + self.name = None + self.rules = None + + +class TrustedAccessRoleBinding(Resource): + """Defines binding between a resource and role. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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 + :ivar roles: A list of roles to bind, each item is a resource type qualified role name. For + example: 'Microsoft.MachineLearningServices/workspaces/reader'. Required. + :vartype roles: list[str] + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "source_resource_id": {"required": True}, + "roles": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "source_resource_id": {"key": "properties.sourceResourceId", "type": "str"}, + "roles": {"key": "properties.roles", "type": "[str]"}, + } + + def __init__(self, *, source_resource_id: str, roles: List[str], **kwargs: Any) -> None: + """ + :keyword source_resource_id: The ARM resource ID of source resource that trusted access is + configured for. Required. + :paramtype source_resource_id: str + :keyword roles: A list of roles to bind, each item is a resource type qualified role name. For + example: 'Microsoft.MachineLearningServices/workspaces/reader'. Required. + :paramtype roles: list[str] + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.source_resource_id = source_resource_id + self.roles = roles + + +class TrustedAccessRoleBindingListResult(_serialization.Model): + """List of trusted access role bindings. + + 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.v2024_04_02_preview.models.TrustedAccessRoleBinding] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[TrustedAccessRoleBinding]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.TrustedAccessRoleBinding"]] = None, **kwargs: Any) -> None: + """ + :keyword value: Role binding list. + :paramtype value: + list[~azure.mgmt.containerservice.v2024_04_02_preview.models.TrustedAccessRoleBinding] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class TrustedAccessRoleListResult(_serialization.Model): + """List of trusted access roles. + + 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.v2024_04_02_preview.models.TrustedAccessRole] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[TrustedAccessRole]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None + + +class TrustedAccessRoleRule(_serialization.Model): + """Rule for trusted access role. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar verbs: List of allowed verbs. + :vartype verbs: list[str] + :ivar api_groups: List of allowed apiGroups. + :vartype api_groups: list[str] + :ivar resources: List of allowed resources. + :vartype resources: list[str] + :ivar resource_names: List of allowed names. + :vartype resource_names: list[str] + :ivar non_resource_ur_ls: List of allowed nonResourceURLs. + :vartype non_resource_ur_ls: list[str] + """ + + _validation = { + "verbs": {"readonly": True}, + "api_groups": {"readonly": True}, + "resources": {"readonly": True}, + "resource_names": {"readonly": True}, + "non_resource_ur_ls": {"readonly": True}, + } + + _attribute_map = { + "verbs": {"key": "verbs", "type": "[str]"}, + "api_groups": {"key": "apiGroups", "type": "[str]"}, + "resources": {"key": "resources", "type": "[str]"}, + "resource_names": {"key": "resourceNames", "type": "[str]"}, + "non_resource_ur_ls": {"key": "nonResourceURLs", "type": "[str]"}, + } + + 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 + + +class UpgradeOverrideSettings(_serialization.Model): + """Settings for overrides when upgrading a cluster. + + :ivar force_upgrade: Whether to force upgrade the cluster. Note that this option instructs + upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + Enable this option only with caution. + :vartype force_upgrade: bool + :ivar until: Until when the overrides are effective. Note that this only matches the start time + of an upgrade, and the effectiveness won't change once an upgrade starts even if the ``until`` + expires as upgrade proceeds. This field is not set by default. It must be set for the overrides + to take effect. + :vartype until: ~datetime.datetime + """ + + _attribute_map = { + "force_upgrade": {"key": "forceUpgrade", "type": "bool"}, + "until": {"key": "until", "type": "iso-8601"}, + } + + def __init__( + self, *, force_upgrade: Optional[bool] = None, until: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """ + :keyword force_upgrade: Whether to force upgrade the cluster. Note that this option instructs + upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + Enable this option only with caution. + :paramtype force_upgrade: bool + :keyword until: Until when the overrides are effective. Note that this only matches the start + time of an upgrade, and the effectiveness won't change once an upgrade starts even if the + ``until`` expires as upgrade proceeds. This field is not set by default. It must be set for the + overrides to take effect. + :paramtype until: ~datetime.datetime + """ + super().__init__(**kwargs) + self.force_upgrade = force_upgrade + self.until = until + + +class VirtualMachineNodes(_serialization.Model): + """Current status on a group of nodes of the same vm size. + + :ivar size: The VM size of the agents used to host this group of nodes. + :vartype size: str + :ivar count: Number of nodes. + :vartype count: int + """ + + _attribute_map = { + "size": {"key": "size", "type": "str"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, size: Optional[str] = None, count: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword size: The VM size of the agents used to host this group of nodes. + :paramtype size: str + :keyword count: Number of nodes. + :paramtype count: int + """ + super().__init__(**kwargs) + self.size = size + self.count = count + + +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.v2024_04_02_preview.models.ScaleProfile + """ + + _attribute_map = { + "scale": {"key": "scale", "type": "ScaleProfile"}, + } + + 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.v2024_04_02_preview.models.ScaleProfile + """ + super().__init__(**kwargs) + self.scale = scale + + +class WeeklySchedule(_serialization.Model): + """For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + + All required parameters must be populated in order to send to server. + + :ivar interval_weeks: Specifies the number of weeks between each set of occurrences. Required. + :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.v2024_04_02_preview.models.WeekDay + """ + + _validation = { + "interval_weeks": {"required": True, "maximum": 4, "minimum": 1}, + "day_of_week": {"required": True}, + } + + _attribute_map = { + "interval_weeks": {"key": "intervalWeeks", "type": "int"}, + "day_of_week": {"key": "dayOfWeek", "type": "str"}, + } + + def __init__(self, *, interval_weeks: int, day_of_week: Union[str, "_models.WeekDay"], **kwargs: Any) -> None: + """ + :keyword interval_weeks: Specifies the number of weeks between each set of occurrences. + Required. + :paramtype interval_weeks: int + :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.v2024_04_02_preview.models.WeekDay + """ + super().__init__(**kwargs) + self.interval_weeks = interval_weeks + self.day_of_week = day_of_week + + +class WindowsGmsaProfile(_serialization.Model): + """Windows gMSA Profile in the managed cluster. + + :ivar enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :vartype enabled: bool + :ivar dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it to + empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :vartype dns_server: str + :ivar root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :vartype root_domain_name: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "dns_server": {"key": "dnsServer", "type": "str"}, + "root_domain_name": {"key": "rootDomainName", "type": "str"}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + dns_server: Optional[str] = None, + root_domain_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword enabled: Specifies whether to enable Windows gMSA in the managed cluster. + :paramtype enabled: bool + :keyword dns_server: Specifies the DNS server for Windows gMSA. :code:`
`:code:`
` Set it + to empty if you have configured the DNS server in the vnet which is used to create the managed + cluster. + :paramtype dns_server: str + :keyword root_domain_name: Specifies the root domain name for Windows gMSA. + :code:`
`:code:`
` Set it to empty if you have configured the DNS server in the vnet + which is used to create the managed cluster. + :paramtype root_domain_name: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.dns_server = dns_server + self.root_domain_name = root_domain_name diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_04_02_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/__init__.py new file mode 100644 index 000000000000..4400927248e5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/__init__.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._managed_clusters_operations import ManagedClustersOperations +from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations +from ._agent_pools_operations import AgentPoolsOperations +from ._machines_operations import MachinesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +from ._operation_status_result_operations import OperationStatusResultOperations +from ._snapshots_operations import SnapshotsOperations +from ._managed_cluster_snapshots_operations import ManagedClusterSnapshotsOperations +from ._trusted_access_roles_operations import TrustedAccessRolesOperations +from ._trusted_access_role_bindings_operations import TrustedAccessRoleBindingsOperations +from ._load_balancers_operations import LoadBalancersOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "MachinesOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "OperationStatusResultOperations", + "SnapshotsOperations", + "ManagedClusterSnapshotsOperations", + "TrustedAccessRolesOperations", + "TrustedAccessRoleBindingsOperations", + "LoadBalancersOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_agent_pools_operations.py new file mode 100644 index 000000000000..d3d1fd3c4f3f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_agent_pools_operations.py @@ -0,0 +1,1588 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_abort_latest_operation_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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) + + +def build_list_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", "2024-04-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( + "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, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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, + agent_pool_name: str, + subscription_id: str, + *, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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}/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", 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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + 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, + agent_pool_name: str, + subscription_id: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ignore_pod_disruption_budget is not None: + _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( + "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" + ) + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_upgrade_profile_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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_delete_machines_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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}/agentPools/{agentPoolName}/deleteMachines", + ) # 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", 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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_available_agent_pool_versions_request( # pylint: disable=name-too-long + 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", "2024-04-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( + "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_upgrade_node_image_version_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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 AgentPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`agent_pools` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Aborts last operation running on agent pool. + + Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + completes before cancellation can take place, an error is returned. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_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 "2024-04-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterable["_models.AgentPool"]: + """Gets a list of agent pools in the specified managed cluster. + + Gets a list of agent pools 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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AgentPoolListResult", 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, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPool: + """Gets the specified managed cluster agent pool. + + Gets the specified managed cluster agent pool. + + :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 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.v2024_04_02_preview.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPool", pipeline_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, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> _models.AgentPool: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentPool] = 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, "AgentPool") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("AgentPool", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("AgentPool", pipeline_response) + + 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, + agent_pool_name: str, + parameters: _models.AgentPool, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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.v2024_04_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 + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 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: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + Creates or updates an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_04_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. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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, + agent_pool_name=agent_pool_name, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("AgentPool", pipeline_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.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes an agent pool in the specified managed cluster. + + Deletes an agent pool 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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + @distributed_trace + def get_upgrade_profile( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> _models.AgentPoolUpgradeProfile: + """Gets the upgrade profile for an agent pool. + + Gets the upgrade profile for an agent pool. + + :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 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.v2024_04_02_preview.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_machines_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(machines, (IOBase, bytes)): + _content = machines + else: + _json = self._serialize.body(machines, "AgentPoolDeleteMachinesParameter") + + _request = build_delete_machines_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: _models.AgentPoolDeleteMachinesParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: + ~azure.mgmt.containerservice.v2024_04_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 + :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: + """ + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + Deletes specific machines in an agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_04_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] + :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 "2024-04-02-preview") + ) + 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) + 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_machines_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machines=machines, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 + + @distributed_trace + def get_available_agent_pool_versions( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.AgentPoolAvailableVersions: + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :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: AgentPoolAvailableVersions or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) + + _request = build_get_available_agent_pool_versions_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _upgrade_node_image_version_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Optional[_models.AgentPool]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[Optional[_models.AgentPool]] = kwargs.pop("cls", None) + + _request = build_upgrade_node_image_version_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_upgrade_node_image_version( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Upgrades the node image version of an agent pool to the latest. + + Upgrading the node image version of an agent pool applies the newest OS and runtime updates to + the nodes. AKS provides one new image per week with the latest updates. For more details on + node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. + + :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 agent_pool_name: The name of the agent pool. Required. + :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.v2024_04_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 "2024-04-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._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + deserialized = self._deserialize("AgentPool", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_load_balancers_operations.py new file mode 100644 index 000000000000..5e54d2fe4715 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_load_balancers_operations.py @@ -0,0 +1,635 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, Union, cast +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_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", "2024-04-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( + "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, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "loadBalancerName": _SERIALIZER.url( + "load_balancer_name", + load_balancer_name, + "str", + max_length=12, + min_length=1, + pattern=r"^[a-z][a-z0-9]{0,11}$", + ), + } + + _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, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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}/loadBalancers/{loadBalancerName}", + ) # 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", 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]$", + ), + "loadBalancerName": _SERIALIZER.url( + "load_balancer_name", + load_balancer_name, + "str", + max_length=12, + min_length=1, + pattern=r"^[a-z][a-z0-9]{0,11}$", + ), + } + + _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, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "loadBalancerName": _SERIALIZER.url( + "load_balancer_name", + load_balancer_name, + "str", + max_length=12, + min_length=1, + pattern=r"^[a-z][a-z0-9]{0,11}$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class LoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`load_balancers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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.LoadBalancer"]: + """Gets a list of load balancers in the specified managed cluster. + + Gets a list of load balancers 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 LoadBalancer or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LoadBalancerListResult", 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, load_balancer_name: str, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + Gets the specified load balancer. + + :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 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.v2024_04_02_preview.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + name: Optional[str] = None, + primary_agent_pool_name: Optional[str] = None, + allow_service_placement: Optional[bool] = None, + service_label_selector: Optional[_models.LabelSelector] = None, + service_namespace_selector: Optional[_models.LabelSelector] = None, + node_selector: Optional[_models.LabelSelector] = None, + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + Creates or updates a load balancer 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 load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param name: Name of the public load balancer. There will be an internal load balancer created + if needed, and the name will be ``-internal``. The internal lb shares the same + configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. There must be a name of kubernetes in the list. Default value is None. + :type name: str + :param 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 + agent pool can only be the primary pool for a single load balancer. Default value is None. + :type primary_agent_pool_name: str + :param allow_service_placement: Whether to automatically place services on the load balancer. + If not supplied, the default value is true. If set to false manually, both of the external and + the internal load balancer will not be selected for services unless they explicitly target it. + Default value is None. + :type allow_service_placement: bool + :param service_label_selector: Only services that must match this selector can be placed on + this load balancer. Default value is None. + :type service_label_selector: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.LabelSelector + :param service_namespace_selector: Services created in namespaces that match the selector can + be placed on this load balancer. Default value is None. + :type service_namespace_selector: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.LabelSelector + :param node_selector: Nodes that match this selector will be possible members of this load + balancer. Default value is None. + :type node_selector: ~azure.mgmt.containerservice.v2024_04_02_preview.models.LabelSelector + :return: LoadBalancer or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _parameters = _models.LoadBalancer( + allow_service_placement=allow_service_placement, + name_properties_name=name, + node_selector=node_selector, + primary_agent_pool_name=primary_agent_pool_name, + service_label_selector=service_label_selector, + service_namespace_selector=service_namespace_selector, + ) + _json = self._serialize.body(_parameters, "LoadBalancer") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("LoadBalancer", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a load balancer in the specified managed cluster. + + Deletes a load balancer 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 load_balancer_name: The name of the load balancer. Required. + :type load_balancer_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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_machines_operations.py new file mode 100644 index 000000000000..2c997b0405ee --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_machines_operations.py @@ -0,0 +1,317 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + } + + _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, + agent_pool_name: str, + machine_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + "machineName": _SERIALIZER.url( + "machine_name", machine_name, "str", pattern=r"^[a-zA-Z0-9][-_a-zA-Z0-9]{0,39}$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class MachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`machines` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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, agent_pool_name: str, **kwargs: Any + ) -> Iterable["_models.Machine"]: + """Gets a list of machines in the specified agent pool. + + Gets a list of machines in the specified agent pool. + + :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 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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MachineListResult", 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, agent_pool_name: str, machine_name: str, **kwargs: Any + ) -> _models.Machine: + """Get a specific machine in the specified agent pool. + + Get a specific machine in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_04_02_preview.models.Machine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Machine", pipeline_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/v2024_04_02_preview/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_maintenance_configurations_operations.py new file mode 100644 index 000000000000..9a9af52cdc24 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_maintenance_configurations_operations.py @@ -0,0 +1,601 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_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", "2024-04-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( + "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, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group_name: str, resource_name: str, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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}/maintenanceConfigurations/{configName}", + ) # 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", 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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _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, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`maintenance_configurations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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.MaintenanceConfiguration"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + Gets a list of maintenance configurations 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 MaintenanceConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MaintenanceConfigurationListResult", 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, config_name: str, **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Gets the specified maintenance configuration of a managed cluster. + + Gets the specified maintenance configuration 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 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.v2024_04_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: _models.MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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.v2024_04_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.v2024_04_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 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: 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: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: Union[_models.MaintenanceConfiguration, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + Creates or updates a maintenance configuration 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 config_name: The name of the maintenance configuration. Required. + :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.v2024_04_02_preview.models.MaintenanceConfiguration or IO[bytes] + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceConfiguration] = 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, "MaintenanceConfiguration") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + Deletes a maintenance configuration. + + :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 config_name: The name of the maintenance configuration. Required. + :type config_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_managed_cluster_snapshots_operations.py new file mode 100644 index 000000000000..3145a385ee20 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -0,0 +1,858 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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"), + } + + _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_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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_create_or_update_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", "2024-04-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/managedclustersnapshots/{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", 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 + 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_update_tags_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", "2024-04-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/managedclustersnapshots/{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", 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 + 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_delete_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", "2024-04-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( + "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class ManagedClusterSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`managed_cluster_snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: + """Gets a list of managed cluster snapshots in the specified subscription. + + Gets a list of managed cluster snapshots in the specified subscription. + + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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 list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.ManagedClusterSnapshot"]: + """Lists managed cluster snapshots in the specified subscription and resource group. + + Lists managed cluster snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterSnapshotListResult", 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, **kwargs: Any) -> _models.ManagedClusterSnapshot: + """Gets a managed cluster snapshot. + + Gets a managed cluster snapshot. + + :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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterSnapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot to create or update. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 parameters: The managed cluster snapshot 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterSnapshot, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + Creates or updates a managed cluster snapshot. + + :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 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.v2024_04_02_preview.models.ManagedClusterSnapshot or IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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, "ManagedClusterSnapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + 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: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + Updates tags on a managed cluster snapshot. + + :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 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.v2024_04_02_preview.models.TagsObject or + IO[bytes] + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a managed cluster snapshot. + + Deletes a managed cluster snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_managed_clusters_operations.py new file mode 100644 index 000000000000..b148898a9cf0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_managed_clusters_operations.py @@ -0,0 +1,4687 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_os_options_request( + location: str, subscription_id: str, *, resource_type: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default", + ) # 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), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if resource_type is not None: + _params["resource-type"] = _SERIALIZER.query("resource_type", resource_type, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_kubernetes_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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), + } + + _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_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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_upgrade_profile_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", "2024-04-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( + "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_access_profile_request( + resource_group_name: str, resource_name: str, role_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "roleName": _SERIALIZER.url("role_name", role_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_admin_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_user_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_cluster_monitoring_user_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_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", "2024-04-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( + "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_create_or_update_request( + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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}", + ) # 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", 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 + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + 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_update_tags_request( + resource_group_name: str, resource_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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}", + ) # 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", 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 + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + 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_delete_request( + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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") + if ignore_pod_disruption_budget is not None: + _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( + "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" + ) + + # Construct headers + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_reset_service_principal_profile_request( # pylint: disable=name-too-long + 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", "2024-04-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_reset_aad_profile_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", "2024-04-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_abort_latest_operation_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", "2024-04-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_rotate_cluster_certificates_request( # pylint: disable=name-too-long + 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", "2024-04-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_rotate_service_account_signing_keys_request( # pylint: disable=name-too-long + 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", "2024-04-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_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", "2024-04-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_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", "2024-04-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( + "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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_run_command_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", "2024-04-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}/runCommand", + ) # 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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_command_result_request( + resource_group_name: str, resource_name: str, command_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "commandId": _SERIALIZER.url("command_id", command_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_outbound_network_dependencies_endpoints_request( # pylint: disable=name-too-long + 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", "2024-04-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( + "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_guardrails_versions_request( + location: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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), + "version": _SERIALIZER.url("version", version, "str", max_length=24, min_length=1), + } + + _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_list_guardrails_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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), + } + + _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_safeguards_versions_request( + location: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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), + "version": _SERIALIZER.url("version", version, "str", max_length=24, min_length=1), + } + + _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_list_safeguards_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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), + } + + _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_list_mesh_revision_profiles_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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), + } + + _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_mesh_revision_profile_request( + location: str, mode: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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), + "mode": _SERIALIZER.url( + "mode", + mode, + "str", + max_length=24, + 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_list_mesh_upgrade_profiles_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", "2024-04-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( + "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_mesh_upgrade_profile_request( + resource_group_name: str, resource_name: str, mode: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "mode": _SERIALIZER.url( + "mode", + mode, + "str", + max_length=24, + 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_rebalance_load_balancers_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", "2024-04-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}/rebalanceLoadBalancers", + ) # 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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ManagedClustersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`managed_clusters` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def get_os_options( + self, location: str, resource_type: Optional[str] = None, **kwargs: Any + ) -> _models.OSOptionProfile: + """Gets supported OS options in the specified subscription. + + Gets supported OS options in the specified subscription. + + :param location: The name of the Azure region. Required. + :type location: str + :param resource_type: The resource type for which the OS options needs to be returned. Default + value is None. + :type resource_type: str + :return: OSOptionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.OSOptionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.OSOptionProfile] = kwargs.pop("cls", None) + + _request = build_get_os_options_request( + location=location, + subscription_id=self._config.subscription_id, + resource_type=resource_type, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OSOptionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: + """Gets a list of supported Kubernetes versions in the specified subscription. + + Contains extra metadata on the version, including supported patch versions, capabilities, + available upgrades, and details on preview status of the version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: KubernetesVersionListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.KubernetesVersionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) + + _request = build_list_kubernetes_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("KubernetesVersionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: + """Gets a list of managed clusters in the specified subscription. + + Gets a list of managed clusters in the specified subscription. + + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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 list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: + """Lists managed clusters in the specified subscription and resource group. + + Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedClusterListResult", 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_upgrade_profile( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.ManagedClusterUpgradeProfile: + """Gets the upgrade profile of a managed cluster. + + Gets the upgrade profile 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 + :return: ManagedClusterUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_upgrade_profile_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_access_profile( + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any + ) -> _models.ManagedClusterAccessProfile: + """Gets an access profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :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 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.v2024_04_02_preview.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) + + _request = build_get_access_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + role_name=role_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_admin_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the admin credentials of a managed cluster. + + Lists the admin credentials 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 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.v2024_04_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_admin_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any + ) -> _models.CredentialResults: + """Lists the user credentials of a managed cluster. + + Lists the user credentials 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :type server_fqdn: str + :param format: Only apply to AAD clusters, specifies the format of returned kubeconfig. Format + '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" and "exec". + Default value is None. + :type format: str or ~azure.mgmt.containerservice.v2024_04_02_preview.models.Format + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + format=format, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_monitoring_user_credentials( + self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the cluster monitoring user credentials of a managed cluster. + + Lists the cluster monitoring user credentials 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 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.v2024_04_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_list_cluster_monitoring_user_credentials_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + server_fqdn=server_fqdn, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("CredentialResults", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: + """Gets a managed cluster. + + Gets 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 + :return: ManagedCluster or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_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, + parameters: Union[_models.ManagedCluster, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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, "ManagedCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + 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, + parameters: _models.ManagedCluster, + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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 + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Required. + :type parameters: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedCluster, IO[bytes]], + if_match: Optional[str] = None, + if_none_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + Creates or updates 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 parameters: The managed cluster to create or update. Is either a ManagedCluster type or + a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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. + :type if_match: str + :param if_none_match: The request should only proceed if no entity matches this string. Default + value is None. + :type if_none_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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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, + parameters=parameters, + if_match=if_match, + if_none_match=if_none_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + if_match: Optional[str] = None, + **kwargs: Any + ) -> _models.ManagedCluster: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = 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_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + if_match=if_match, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ManagedCluster", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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 + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + if_match: Optional[str] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: IO[bytes] + :param if_match: The request should only proceed if an entity matches this string. Default + value is None. + :type if_match: str + :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 ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + Updates tags on 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 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.v2024_04_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. + :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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + if_match=if_match, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedCluster", pipeline_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.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + ignore_pod_disruption_budget: Optional[bool] = None, + if_match: Optional[str] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a managed cluster. + + Deletes 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 ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on + a node without considering Pod Disruption Budget. Default value is None. + :type ignore_pod_disruption_budget: bool + :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 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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + if_match=if_match, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 + + def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterServicePrincipalProfile") + + _request = build_reset_service_principal_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterServicePrincipalProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_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 + :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: + """ + + @overload + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 parameters: The service principal profile to set on the managed cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :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 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.v2024_04_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] + :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 "2024-04-02-preview") + ) + 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) + 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._reset_service_principal_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "ManagedClusterAADProfile") + + _request = build_reset_aad_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterAADProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_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 + :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: + """ + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 parameters: The AAD profile to set on the Managed Cluster. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :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 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.v2024_04_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: + """ + _headers = case_insensitive_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 "2024-04-02-preview") + ) + 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) + 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._reset_aad_profile_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _abort_latest_operation_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_abort_latest_operation_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Aborts last operation running on managed cluster. + + Aborts the currently running operation on the managed cluster. The Managed Cluster will be + moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If + the operation completes before cancellation can take place, an error is returned. + + :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 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 "2024-04-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._abort_latest_operation_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_cluster_certificates_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_rotate_cluster_certificates( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :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 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 "2024-04-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._rotate_cluster_certificates_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements,name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_rotate_service_account_signing_keys_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Rotates the service account signing keys of a managed cluster. + + Rotates the service account signing keys 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 + :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 "2024-04-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._rotate_service_account_signing_keys_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_stop_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + 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 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 "2024-04-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._stop_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a 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 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 "2024-04-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._start_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_payload, (IOBase, bytes)): + _content = request_payload + else: + _json = self._serialize.body(request_payload, "RunCommandRequest") + + _request = build_run_command_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: _models.RunCommandRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Required. + :type request_payload: 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 RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :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 request_payload: The run command request. Is either a RunCommandRequest type or a + IO[bytes] type. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2024_04_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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("RunCommandResult", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RunCommandResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RunCommandResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_command_result( + self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + """Gets the results of a command which has been run on the Managed Cluster. + + Gets the results of a command which has been run on the 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 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.v2024_04_02_preview.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + _request = build_get_command_result_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + command_id=command_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterable["_models.OutboundEnvironmentEndpoint"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :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 OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_outbound_network_dependencies_endpoints_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", 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_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> _models.GuardrailsAvailableVersion: + """Gets supported Guardrails version in the specified subscription and location. + + Contains Guardrails version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: GuardrailsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.GuardrailsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_guardrails_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GuardrailsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_guardrails_versions(self, location: str, **kwargs: Any) -> Iterable["_models.GuardrailsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either GuardrailsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_guardrails_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GuardrailsAvailableVersionsList", 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_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> _models.SafeguardsAvailableVersion: + """Gets supported Safeguards version in the specified subscription and location. + + Contains Safeguards version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: SafeguardsAvailableVersion or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.SafeguardsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_get_safeguards_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SafeguardsAvailableVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_safeguards_versions(self, location: str, **kwargs: Any) -> Iterable["_models.SafeguardsAvailableVersion"]: + """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 + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of either SafeguardsAvailableVersion or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_safeguards_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SafeguardsAvailableVersionsList", 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 list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> Iterable["_models.MeshRevisionProfile"]: + """Lists mesh revision profiles for all meshes in the specified location. + + Contains extra metadata on each revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_revision_profiles_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MeshRevisionProfileList", 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_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: + """Gets a mesh revision profile for a specified mesh in the specified location. + + Contains extra metadata on the revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshRevisionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshRevisionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_revision_profile_request( + location=location, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshRevisionProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_upgrade_profiles( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterable["_models.MeshUpgradeProfile"]: + """Lists available upgrades for all service meshes in a specific cluster. + + Lists available upgrades for all service meshes in a specific 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 MeshUpgradeProfile or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_mesh_upgrade_profiles_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("MeshUpgradeProfileList", 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_mesh_upgrade_profile( + self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any + ) -> _models.MeshUpgradeProfile: + """Gets available upgrades for a service mesh in a cluster. + + Gets available upgrades for a service mesh in a 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 mode: The mode of the mesh. Required. + :type mode: str + :return: MeshUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.MeshUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_get_mesh_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("MeshUpgradeProfile", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _rebalance_load_balancers_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], + **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "RebalanceLoadBalancersRequestBody") + + _request = build_rebalance_load_balancers_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + 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 = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @overload + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.RebalanceLoadBalancersRequestBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 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.v2024_04_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 + :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: + """ + + @overload + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + Rebalance nodes across specific load balancers. + + :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 parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Is either a RebalanceLoadBalancersRequestBody type or a IO[bytes] + type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_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] + :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 "2024-04-02-preview") + ) + 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) + 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._rebalance_load_balancers_initial( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_operation_status_result_operations.py new file mode 100644 index 000000000000..ca26994e101c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_operation_status_result_operations.py @@ -0,0 +1,416 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-04-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( + "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, operation_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str", min_length=1), + } + + _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_by_agent_pool_request( + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + operation_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "agentPoolName": _SERIALIZER.url( + "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" + ), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class OperationStatusResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`operation_status_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> Iterable["_models.OperationStatusResult"]: + """Gets a list of operations in the specified managedCluster. + + Gets a list of operations in the specified managedCluster. + + :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 OperationStatusResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationStatusResultList", 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, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified managed cluster. + + Get the status of a specific operation 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 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.v2024_04_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_by_agent_pool( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified agent pool. + + Get the status of a specific operation in the specified agent pool. + + :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 agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :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.v2024_04_02_preview.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_get_by_agent_pool_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OperationStatusResult", pipeline_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/v2024_04_02_preview/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_operations.py new file mode 100644 index 000000000000..0dd9cac3c0de --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_operations.py @@ -0,0 +1,161 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +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", "2024-04-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.ContainerService/operations") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: + """Gets a list of operations. + + Gets a list of operations. + + :return: An iterator like instance of either OperationValue or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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/v2024_04_02_preview/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..260ccc8d6c7b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,638 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-04-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( + "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, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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}/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", 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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _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, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> _models.PrivateEndpointConnectionListResult: + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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 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.v2024_04_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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.v2024_04_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.v2024_04_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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: 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: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + Updates a private endpoint connection. + + :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 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. Is either a + PrivateEndpointConnection type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnection or IO[bytes] + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = 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, "PrivateEndpointConnection") + + _request = build_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection. + + Deletes a private endpoint connection. + + :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_private_link_resources_operations.py new file mode 100644 index 000000000000..98762c6c9205 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,163 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, Type, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-04-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( + "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) + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`private_link_resources` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> _models.PrivateLinkResourcesListResult: + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + https://docs.microsoft.com/azure/aks/private-clusters. + + :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: PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) + + _request = build_list_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_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/v2024_04_02_preview/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_resolve_private_link_service_id_operations.py new file mode 100644 index 000000000000..4d4811febf94 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,244 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_post_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", "2024-04-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}/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", 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 + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class ResolvePrivateLinkServiceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`resolve_private_link_service_id` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.PrivateLinkResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 parameters: Parameters required in order to resolve a private link service ID. 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: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.PrivateLinkResource, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + Gets the private link service ID for 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 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.v2024_04_02_preview.models.PrivateLinkResource + or IO[bytes] + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkResource] = 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, "PrivateLinkResource") + + _request = build_post_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("PrivateLinkResource", pipeline_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/v2024_04_02_preview/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_snapshots_operations.py new file mode 100644 index 000000000000..45e268bc164f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_snapshots_operations.py @@ -0,0 +1,848 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _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, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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_create_or_update_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", "2024-04-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/snapshots/{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", 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 + 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_update_tags_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", "2024-04-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/snapshots/{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", 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 + 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_delete_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", "2024-04-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( + "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class SnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`snapshots` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: + """Gets a list of snapshots in the specified subscription. + + 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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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 list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Snapshot"]: + """Lists snapshots in the specified subscription and resource group. + + Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SnapshotListResult", 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, **kwargs: Any) -> _models.Snapshot: + """Gets a snapshot. + + Gets a snapshot. + + :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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + _request = build_get_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.Snapshot, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + Creates or updates a snapshot. + + :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 parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot or IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Snapshot") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. Required. + :type parameters: ~azure.mgmt.containerservice.v2024_04_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.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 parameters: Parameters supplied to the Update snapshot Tags operation. 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: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, IO[bytes]], + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + Updates tags on a snapshot. + + :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 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.v2024_04_02_preview.models.TagsObject or + IO[bytes] + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2024_04_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + _request = build_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Snapshot", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a snapshot. + + Deletes a snapshot. + + :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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_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 = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_trusted_access_role_bindings_operations.py new file mode 100644 index 000000000000..2717cee36851 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -0,0 +1,750 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from io import IOBase +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, cast, overload +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_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", "2024-04-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( + "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, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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_create_or_update_request( + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", + ) # 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", 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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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 + 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, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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( + "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]$", + ), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", + trusted_access_role_binding_name, + "str", + max_length=24, + min_length=1, + pattern=r"^([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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class TrustedAccessRoleBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`trusted_access_role_bindings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + 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 + ) -> Iterable["_models.TrustedAccessRoleBinding"]: + """List trusted access role bindings. + + List trusted access role bindings. + + :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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBindingListResult", 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, trusted_access_role_binding_name: str, **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + """Get a trusted access role binding. + + Get a trusted access role binding. + + :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 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.v2024_04_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> _models.TrustedAccessRoleBinding: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(trusted_access_role_binding, (IOBase, bytes)): + _content = trusted_access_role_binding + else: + _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) + + 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, + trusted_access_role_binding_name: str, + trusted_access_role_binding: _models.TrustedAccessRoleBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :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.v2024_04_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.v2024_04_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :param trusted_access_role_binding: A trusted access role binding. Required. + :type trusted_access_role_binding: 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 TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2024_04_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + Create or update a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :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.v2024_04_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.v2024_04_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 "2024-04-02-preview") + ) + 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) + 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, + trusted_access_role_binding_name=trusted_access_role_binding_name, + trusted_access_role_binding=trusted_access_role_binding, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_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.TrustedAccessRoleBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TrustedAccessRoleBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> None: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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 "2024-04-02-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a trusted access role binding. + + Delete a trusted access role binding. + + :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 trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_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 "2024-04-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( # type: ignore + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # 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 diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_trusted_access_roles_operations.py new file mode 100644 index 000000000000..9a825f6be503 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/operations/_trusted_access_roles_operations.py @@ -0,0 +1,174 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import _convert_request + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-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), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class TrustedAccessRolesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.v2024_04_02_preview.ContainerServiceClient`'s + :attr:`trusted_access_roles` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._api_version = input_args.pop(0) if input_args else kwargs.pop("api_version") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessRole"]: + """List supported trusted access roles. + + List supported trusted access roles. + + :param location: The name of the Azure region. Required. + :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.v2024_04_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 "2024-04-02-preview") + ) + cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request = _convert_request(_request) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("TrustedAccessRoleListResult", 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) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2024_04_02_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file 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 a7a7c07c4e19..3b48b7ceeca4 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsAbortOperation.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsAbortOperation.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_associate_crg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_associate_crg.py new file mode 100644 index 000000000000..50643ec7cd69 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_associate_crg.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python agent_pools_associate_crg.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.agent_pools.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + parameters={ + "properties": { + "capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1", + "count": 3, + "orchestratorVersion": "", + "osType": "Linux", + "vmSize": "Standard_DS2_v2", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsAssociate_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 01dc42c4880a..5f0774d570d8 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 @@ -69,6 +69,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_CustomNodeConfig.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 28d9a1cad50c..ab27b84a669c 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_DedicatedHostGroup.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_custom_ca_trust.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_custom_ca_trust.py new file mode 100644 index 000000000000..b033c49c3ccc --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_custom_ca_trust.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python agent_pools_create_enable_custom_ca_trust.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.agent_pools.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + parameters={ + "properties": { + "count": 3, + "enableCustomCATrust": True, + "orchestratorVersion": "", + "osType": "Linux", + "vmSize": "Standard_DS2_v2", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsCreate_EnableCustomCATrust.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 92c202e49bbc..4c9faf2f8a80 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 ad7a6e6b19a4..6ef6ddad839f 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_EnableFIPS.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 e1cc0f07e9de..142a45bea639 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_EnableUltraSSD.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 048f530de8f3..8600af6d6574 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 @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_Ephemeral.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 8fe21f309d15..cb0160dd3561 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 @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_GPUMIG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 new file mode 100644 index 000000000000..33b51d6d08b6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python agent_pools_create_message_of_the_day.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.agent_pools.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + parameters={ + "properties": { + "count": 3, + "messageOfTheDay": "Zm9vCg==", + "mode": "User", + "orchestratorVersion": "", + "osDiskSizeGB": 64, + "osType": "Linux", + "vmSize": "Standard_DS2_v2", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 d5dfe9bcc277..0450a220a157 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 @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_OSSKU.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 68f5ac43b841..6a64e1c7d828 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_PPG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 97391ec24b04..cbf768c8a015 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 @@ -40,7 +40,7 @@ def main(): "properties": { "count": 3, "creationData": { - "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" }, "enableFIPS": True, "orchestratorVersion": "", @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_Snapshot.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 1db6c5558d1d..f077e7227b7d 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 @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_Spot.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsCreate_Spot.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines.py new file mode 100644 index 000000000000..bd54a48ccc07 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python agent_pools_create_type_virtual_machines.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.agent_pools.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + parameters={ + "properties": { + "nodeLabels": {"key1": "val1"}, + "nodeTaints": ["Key1=Value1:NoSchedule"], + "orchestratorVersion": "1.9.6", + "osType": "Linux", + "tags": {"name1": "val1"}, + "type": "VirtualMachines", + "virtualMachinesProfile": { + "scale": {"manual": [{"count": 5, "sizes": ["Standard_D2_v2", "Standard_D2_v3"]}]} + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsCreate_TypeVirtualMachines.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines_autoscale.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines_autoscale.py new file mode 100644 index 000000000000..7ec34782c0b0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines_autoscale.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python agent_pools_create_type_virtual_machines_autoscale.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.agent_pools.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + parameters={ + "properties": { + "nodeLabels": {"key1": "val1"}, + "nodeTaints": ["Key1=Value1:NoSchedule"], + "orchestratorVersion": "1.29.0", + "osType": "Linux", + "tags": {"name1": "val1"}, + "type": "VirtualMachines", + "virtualMachinesProfile": { + "scale": { + "autoscale": [{"maxCount": 5, "minCount": 1, "sizes": ["Standard_D2_v2", "Standard_D2_v3"]}] + } + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsCreate_TypeVirtualMachines_Autoscale.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 339b61ec1804..d44440bdeecd 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 @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_Update.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 7a11163e1ebc..2090f4b495c1 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 @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_WasmWasi.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 a84eea64bf8d..485a27d4b832 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 @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 2dd8aab9ede3..95084bf8c4f8 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsCreate_WindowsOSSKU.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 4c0b8691a3fb..669d8e5dfcc3 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_ignore_pod_disruption_budget.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_ignore_pod_disruption_budget.py new file mode 100644 index 000000000000..97ab141aadaa --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_ignore_pod_disruption_budget.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python agent_pools_delete_ignore_pod_disruption_budget.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.agent_pools.begin_delete( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + ).result() + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.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 new file mode 100644 index 000000000000..8eeea8e8281e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python agent_pools_delete_machines.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.agent_pools.begin_delete_machines( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + machines={"machineNames": ["aks-nodepool1-42263519-vmss00000a", "aks-nodepool1-42263519-vmss00000b"]}, + ).result() + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 b0838899f130..74ced28c7f6f 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 d91eb7462456..9782de14ba72 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 7fd3f51698f4..0d5859595bee 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsGetUpgradeProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 54dede4c6ca5..99100e1f45c6 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 bad8a546613b..0d20c900a295 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 @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPools_Start.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 fd00e7a797ce..8a0426ef96bc 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 @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPools_Stop.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 be5d2cb8a8fb..5724853a56f7 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 @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPools_Update.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 f88d04aa5ce6..7960f9344c60 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/AgentPoolsUpgradeNodeImageVersion.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/container_service_get_os_options.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/container_service_get_os_options.py index 4c69fe7904ab..82033f3177d2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/container_service_get_os_options.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/container_service_get_os_options.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ContainerServiceGetOSOptions.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ContainerServiceGetOSOptions.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_guardrails_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_guardrails_versions.py new file mode 100644 index 000000000000..cb2c724b41a6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_guardrails_versions.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python get_guardrails_versions.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.get_guardrails_versions( + location="location1", + version="v1.0.0", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/GetGuardrailsVersions.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_safeguards_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_safeguards_versions.py new file mode 100644 index 000000000000..33fb38e06c9a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_safeguards_versions.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python get_safeguards_versions.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.get_safeguards_versions( + location="location1", + version="v1.0.0", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/GetSafeguardsVersions.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 3905e42ec290..9ab05431d585 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/KubernetesVersions_List.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/KubernetesVersions_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_guardrails_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_guardrails_versions.py new file mode 100644 index 000000000000..593f275dda16 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_guardrails_versions.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python list_guardrails_versions.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.list_guardrails_versions( + location="location1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ListGuardrailsVersions.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_safeguards_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_safeguards_versions.py new file mode 100644 index 000000000000..7ae51797a454 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_safeguards_versions.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python list_safeguards_versions.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.list_safeguards_versions( + location="location1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ListSafeguardsVersions.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_create_or_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_create_or_update.py new file mode 100644 index 000000000000..f6e005295835 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_create_or_update.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python load_balancers_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.load_balancers.create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + load_balancer_name="kubernetes", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/LoadBalancers_Create_Or_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_delete.py new file mode 100644 index 000000000000..4c0db9951cb6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python load_balancers_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.load_balancers.begin_delete( + resource_group_name="rg1", + resource_name="clustername1", + load_balancer_name="kubernetes", + ).result() + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/LoadBalancers_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_get.py new file mode 100644 index 000000000000..067c46617ac3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python load_balancers_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.load_balancers.get( + resource_group_name="rg1", + resource_name="clustername1", + load_balancer_name="kubernetes", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/LoadBalancers_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_list.py new file mode 100644 index 000000000000..7ddbfe304471 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python load_balancers_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.load_balancers.list_by_managed_cluster( + resource_group_name="rg1", + resource_name="clustername1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/LoadBalancers_List.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_rebalance.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_rebalance.py new file mode 100644 index 000000000000..73db4b8d633b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_rebalance.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python load_balancers_rebalance.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.managed_clusters.begin_rebalance_load_balancers( + resource_group_name="rg1", + resource_name="clustername1", + parameters={"loadBalancerNames": ["kubernetes"]}, + ).result() + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/LoadBalancers_Rebalance.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 new file mode 100644 index 000000000000..47a85e5627a2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python machine_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.machines.get( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + machine_name="aks-nodepool1-42263519-vmss00000t", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 new file mode 100644 index 000000000000..3e1fa004d29b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python machine_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.machines.list( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 4da666db7e18..899293aae7a5 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 @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/MaintenanceConfigurationsCreate_Update.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 4151fdcdbf55..44836bd3fe60 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 @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 f98622e867ba..1fbb1bdf1962 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 @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/MaintenanceConfigurationsDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 377187edb6e7..d016c0470a6d 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 @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 01bb8c327616..de67554755ff 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/MaintenanceConfigurationsGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 ab0216aa6414..14117baa2989 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 ecb902e2369e..a6bcd4773f0d 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/MaintenanceConfigurationsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 d074887c80bc..02b039fce45b 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_create.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_create.py new file mode 100644 index 000000000000..296b2a3928e8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_create.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_cluster_snapshots_create.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_cluster_snapshots.create_or_update( + resource_group_name="rg1", + resource_name="snapshot1", + parameters={ + "location": "westus", + "properties": { + "creationData": { + "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1" + } + }, + "tags": {"key1": "val1", "key2": "val2"}, + }, + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClusterSnapshotsCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_delete.py new file mode 100644 index 000000000000..1d623d1f4ca8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_cluster_snapshots_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.managed_cluster_snapshots.delete( + resource_group_name="rg1", + resource_name="snapshot1", + ) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClusterSnapshotsDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_get.py new file mode 100644 index 000000000000..9c8d909fc53c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_cluster_snapshots_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_cluster_snapshots.get( + resource_group_name="rg1", + resource_name="snapshot1", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClusterSnapshotsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list.py new file mode 100644 index 000000000000..b02e3809267e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_cluster_snapshots_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_cluster_snapshots.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClusterSnapshotsList.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list_by_resource_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list_by_resource_group.py new file mode 100644 index 000000000000..8b2cadf86728 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list_by_resource_group.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_cluster_snapshots_list_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_cluster_snapshots.list_by_resource_group( + resource_group_name="rg1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_update_tags.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_update_tags.py new file mode 100644 index 000000000000..99606069b6b1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_update_tags.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_cluster_snapshots_update_tags.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_cluster_snapshots.update_tags( + resource_group_name="rg1", + resource_name="snapshot1", + parameters={"tags": {"key2": "new-val2", "key3": "val3"}}, + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClusterSnapshotsUpdateTags.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 4b31696a5af2..105dd37afbe4 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersAbortOperation.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersAbortOperation.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_associate_crg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_associate_crg.py new file mode 100644 index 000000000000..009d2f47c6d0 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_associate_crg.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_associate_crg.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + parameters={ + "location": "location1", + "properties": { + "addonProfiles": {}, + "agentPoolProfiles": [ + { + "capacityReservationGroupID": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1", + "count": 3, + "enableNodePublicIP": True, + "mode": "System", + "name": "nodepool1", + "osType": "Linux", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2", + } + ], + "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"}]}}, + "networkProfile": { + "loadBalancerProfile": {"managedOutboundIPs": {"count": 2}}, + "loadBalancerSku": "standard", + "outboundType": "loadBalancer", + }, + "servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"}, + "windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"}, + }, + "sku": {"name": "Basic", "tier": "Free"}, + "tags": {"archv2": "", "tier": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersAssociate_CRG.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 b1434ee3ef01..6ac6b996d2e4 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 @@ -56,7 +56,7 @@ 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, @@ -77,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 19ad6ef4d814..c0582b698ef2 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 @@ -56,7 +56,7 @@ 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, @@ -95,6 +95,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_AzureServiceMesh.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_AzureServiceMesh.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 3d4c27d60983..999decf5c697 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 @@ -51,7 +51,7 @@ 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": False, "enableRBAC": True, @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_DedicatedHostGroup.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 21fa35b4170c..b8d09200c0e8 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 @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_DisableRunCommand.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 536b7553661f..611ac81ad04a 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 @@ -39,7 +39,7 @@ def main(): "identity": { "type": "UserAssigned", "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} }, }, "location": "location1", @@ -67,7 +67,7 @@ def main(): "scan-interval": "20s", "skip-nodes-with-system-pods": "false", }, - "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, @@ -89,6 +89,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_DualStackNetworking.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ai_toolchain_operator.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ai_toolchain_operator.py new file mode 100644 index 000000000000..6f7590c78fd3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ai_toolchain_operator.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_create_enable_ai_toolchain_operator.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + parameters={ + "location": "location1", + "properties": { + "addonProfiles": {}, + "agentPoolProfiles": [ + { + "count": 3, + "enableNodePublicIP": True, + "mode": "System", + "name": "nodepool1", + "osType": "Linux", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2", + } + ], + "aiToolchainOperatorProfile": {"enabled": True}, + "dnsPrefix": "dnsprefix1", + "enableRBAC": True, + "kubernetesVersion": "", + "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, + "networkProfile": { + "loadBalancerProfile": {"managedOutboundIPs": {"count": 2}}, + "loadBalancerSku": "standard", + "networkDataplane": "cilium", + "networkPlugin": "azure", + "networkPluginMode": "overlay", + "outboundType": "loadBalancer", + }, + "servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"}, + }, + "sku": {"name": "Basic", "tier": "Free"}, + "tags": {"archv2": "", "tier": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_EnableAIToolchainOperator.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_custom_ca_trust.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_custom_ca_trust.py new file mode 100644 index 000000000000..461a2b7985c5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_custom_ca_trust.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_create_enable_custom_ca_trust.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + parameters={ + "location": "location1", + "properties": { + "addonProfiles": {}, + "agentPoolProfiles": [ + { + "count": 3, + "enableCustomCATrust": True, + "enableNodePublicIP": True, + "mode": "System", + "name": "nodepool1", + "osType": "Linux", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2", + } + ], + "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"}]}}, + "networkProfile": { + "loadBalancerProfile": {"managedOutboundIPs": {"count": 2}}, + "loadBalancerSku": "standard", + "outboundType": "loadBalancer", + }, + "securityProfile": { + "customCATrustCertificates": ["ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ="] + }, + "servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"}, + "windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"}, + }, + "sku": {"name": "Basic", "tier": "Free"}, + "tags": {"archv2": "", "tier": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_EnableCustomCATrust.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 f184268a5c8a..eafd4c82443c 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 @@ -52,7 +52,7 @@ 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, @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 646d1901c107..2763ed7939ed 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 @@ -52,7 +52,7 @@ 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, @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_EnableUltraSSD.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 ee9ebd4bb094..7f8518371a80 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 @@ -52,7 +52,7 @@ 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": False, "enableRBAC": True, @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_EnabledFIPS.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 7327d64990de..2bcc2808552e 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 @@ -52,7 +52,7 @@ 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, @@ -79,6 +79,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_GPUMIG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 751a1f2cf548..10d38ebd543c 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 @@ -51,7 +51,7 @@ 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, @@ -78,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_HTTPProxy.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 294a32b681c3..6afb65c6d4fb 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 @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 3fb65322bdf3..4fa9093dfadc 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 @@ -51,7 +51,7 @@ 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, @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_ManagedNATGateway.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_mcsnapshot.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_mcsnapshot.py new file mode 100644 index 000000000000..8f9fecb16f11 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_mcsnapshot.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_create_mcsnapshot.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + parameters={ + "location": "location1", + "properties": { + "agentPoolProfiles": [ + { + "count": 3, + "enableFIPS": True, + "enableNodePublicIP": True, + "mode": "System", + "name": "nodepool1", + "osType": "Linux", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2", + } + ], + "creationData": { + "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1" + }, + "dnsPrefix": "dnsprefix1", + "kubernetesVersion": "", + "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, + "servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"}, + }, + "sku": {"name": "Basic", "tier": "Free"}, + "tags": {"archv2": "", "tier": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_MCSnapshot.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_auto_provisioning.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_auto_provisioning.py new file mode 100644 index 000000000000..6641e3291589 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_auto_provisioning.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_create_node_auto_provisioning.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + parameters={ + "location": "location1", + "properties": { + "addonProfiles": {}, + "agentPoolProfiles": [ + { + "count": 3, + "enableNodePublicIP": True, + "mode": "System", + "name": "nodepool1", + "osType": "Linux", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS2_v2", + } + ], + "dnsPrefix": "dnsprefix1", + "enablePodSecurityPolicy": True, + "enableRBAC": True, + "kubernetesVersion": "", + "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, + "networkProfile": { + "loadBalancerProfile": {"managedOutboundIPs": {"count": 2}}, + "loadBalancerSku": "standard", + "networkDataplane": "cilium", + "networkPlugin": "azure", + "networkPluginMode": "overlay", + "outboundType": "loadBalancer", + }, + "servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"}, + }, + "sku": {"name": "Basic", "tier": "Free"}, + "tags": {"archv2": "", "tier": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_NodeAutoProvisioning.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 992d34a07a95..1ab4723d4cae 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 @@ -52,7 +52,7 @@ 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, @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 50010141899b..70dc8b5d6df3 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 @@ -52,7 +52,7 @@ 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, @@ -79,6 +79,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_OSSKU.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 7597ec10c316..47d85b38b4c5 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 @@ -51,7 +51,7 @@ 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, @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_PodIdentity.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 5f7de59fa86b..bdd2d38c2f2c 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 @@ -52,7 +52,7 @@ 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, @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_PPG.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 2cde14d5dd5d..039603e05a93 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 @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_Premium.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 484b2d0cb48a..e378a0f356cb 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 @@ -76,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 fc2b8310ff16..baf5d4df3518 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 @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 f789b21308c8..65a6864ba9ce 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 @@ -61,8 +61,7 @@ def main(): "defender": { "logAnalyticsWorkspaceResourceId": "/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME", "securityMonitoring": {"enabled": True}, - }, - "workloadIdentity": {"enabled": True}, + } }, }, "sku": {"name": "Basic", "tier": "Free"}, @@ -72,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_SecurityProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 b2550c7f5514..76bfe02e72e0 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 @@ -43,7 +43,7 @@ def main(): { "count": 3, "creationData": { - "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" }, "enableFIPS": True, "enableNodePublicIP": True, @@ -55,7 +55,7 @@ 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": False, "enableRBAC": True, @@ -76,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_Snapshot.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 36b30b72e686..f3e768c7c4dc 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 @@ -39,7 +39,7 @@ def main(): "identity": { "type": "UserAssigned", "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} }, }, "location": "location1", @@ -67,7 +67,7 @@ def main(): "scan-interval": "20s", "skip-nodes-with-system-pods": "false", }, - "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, @@ -79,7 +79,7 @@ def main(): "outboundType": "loadBalancer", }, "servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"}, - "upgradeSettings": {"overrideSettings": {"forceUpgrade": False, "until": "2022-11-01T13:00:00Z"}}, + "upgradeSettings": {"overrideSettings": {"forceUpgrade": True, "until": "2022-11-01T13:00:00Z"}}, "windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"}, }, "sku": {"name": "Basic", "tier": "Free"}, @@ -89,6 +89,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_Update.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 91ac8229b705..4b8563904a42 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 @@ -39,7 +39,7 @@ def main(): "identity": { "type": "UserAssigned", "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} }, }, "location": "location1", @@ -58,7 +58,7 @@ 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, @@ -83,6 +83,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 9c375790203c..ec3c20bb7f3c 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 @@ -39,7 +39,7 @@ def main(): "identity": { "type": "UserAssigned", "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} }, }, "location": "location1", @@ -58,7 +58,7 @@ 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, @@ -83,6 +83,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_UpdateWithAHUB.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 100f3feaa710..0aa9af523538 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 @@ -53,7 +53,7 @@ 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, @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_namespace_resources.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_namespace_resources.py new file mode 100644 index 000000000000..1311f1e81df7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_namespace_resources.py @@ -0,0 +1,79 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_create_update_with_enable_namespace_resources.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + parameters={ + "location": "location1", + "properties": { + "addonProfiles": {}, + "agentPoolProfiles": [ + { + "availabilityZones": ["1", "2", "3"], + "count": 3, + "enableNodePublicIP": True, + "mode": "System", + "name": "nodepool1", + "osType": "Linux", + "type": "VirtualMachineScaleSets", + "vmSize": "Standard_DS1_v2", + } + ], + "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", + "enableNamespaceResources": True, + "enablePodSecurityPolicy": True, + "enableRBAC": True, + "kubernetesVersion": "", + "linuxProfile": {"adminUsername": "azureuser", "ssh": {"publicKeys": [{"keyData": "keydata"}]}}, + "networkProfile": { + "loadBalancerProfile": {"managedOutboundIPs": {"count": 2}}, + "loadBalancerSku": "standard", + "outboundType": "loadBalancer", + }, + "servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"}, + "windowsProfile": {"adminPassword": "replacePassword1234$", "adminUsername": "azureuser"}, + }, + "sku": {"name": "Basic", "tier": "Free"}, + "tags": {"archv2": "", "tier": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.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 4b206dcafa5f..7e3e706efa8e 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 @@ -51,7 +51,7 @@ 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, @@ -68,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_virtual_machines.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_virtual_machines.py new file mode 100644 index 000000000000..8aec94448033 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_virtual_machines.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, IO, Union + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_create_virtual_machines.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.begin_create_or_update( + resource_group_name="rg1", + resource_name="clustername1", + parameters={ + "location": "location1", + "properties": { + "addonProfiles": {}, + "agentPoolProfiles": [ + { + "count": 3, + "enableFIPS": True, + "mode": "System", + "name": "nodepool1", + "osType": "Linux", + "type": "VirtualMachines", + "vmSize": "Standard_DS2_v2", + } + ], + "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"}]}}, + "networkProfile": { + "loadBalancerProfile": {"managedOutboundIPs": {"count": 2}}, + "loadBalancerSku": "standard", + "outboundType": "loadBalancer", + }, + "servicePrincipalProfile": {"clientId": "clientid", "secret": "secret"}, + }, + "sku": {"name": "Basic", "tier": "Free"}, + "tags": {"archv2": "", "tier": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersCreate_VirtualMachines.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 104066635c8e..f658a62bac88 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 2a22d660d1aa..5cfe2a759d27 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 37d5430c209b..365461654034 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersGetAccessProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 98fdd59a2616..a05b1b2feeb0 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersGet_MeshRevisionProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 25fc1686530a..4491b6b453e5 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersGet_MeshUpgradeProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 9c72a64d20b4..f6d21f19c487 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersGetUpgradeProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 b650f98ff8c8..892ad5177eba 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 @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 eb02c7f5a62d..d6cfe7807ced 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersListByResourceGroup.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_credential_result.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_credential_result.py new file mode 100644 index 000000000000..c06c31cf5594 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_credential_result.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_list_cluster_credential_result.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.managed_clusters.list_cluster_admin_credentials( + resource_group_name="rg1", + resource_name="clustername1", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/ManagedClustersListClusterCredentialResult.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 b38135297396..8fef7f837455 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersList_MeshRevisionProfiles.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 4446180246a7..f1f1f496dede 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersList_MeshUpgradeProfiles.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 f8257f5b6efb..6b4dbffc5d7a 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 @@ -44,6 +44,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersResetAADProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 c2d01903b0f9..df0cdf583280 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 @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersResetServicePrincipalProfile.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 8d385f21c1b4..c1371374e576 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersRotateClusterCertificates.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 f1a467378974..2c2f55695de9 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 282b9ebd94d9..efc8b19ad6ed 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersStart.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 e4d695411759..0ed3386b3229 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 @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersStop.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 9db611756d63..930ee2b34dac 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersUpdateTags.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 9fadd04b3880..72b0fc7f619a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/Operation_List.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/Operation_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get.py new file mode 100644 index 000000000000..b9479d7734e4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python operation_status_result_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.operation_status_result.get( + resource_group_name="rg1", + resource_name="clustername1", + operation_id="00000000-0000-0000-0000-000000000001", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/OperationStatusResultGet.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get_by_agent_pool.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get_by_agent_pool.py new file mode 100644 index 000000000000..6b1a7d15dad4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get_by_agent_pool.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python operation_status_result_get_by_agent_pool.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.operation_status_result.get_by_agent_pool( + resource_group_name="rg1", + resource_name="clustername1", + agent_pool_name="agentpool1", + operation_id="00000000-0000-0000-0000-000000000001", + ) + print(response) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/OperationStatusResultGetByAgentPool.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_list.py new file mode 100644 index 000000000000..1d9ad118b68e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python operation_status_result_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.operation_status_result.list( + resource_group_name="rg1", + resource_name="clustername1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/OperationStatusResultList.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 f2a6986e1aee..8b9f043d37fa 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/OutboundNetworkDependenciesEndpointsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 aef412c12937..700c3c004c80 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/PrivateEndpointConnectionsDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 0175cbff4c97..f01dc7aef8bc 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/PrivateEndpointConnectionsGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 83f9593b5fc5..9d8b09464d9d 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/PrivateEndpointConnectionsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 2712e0c0f42d..a7688ae2506d 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 @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/PrivateEndpointConnectionsUpdate.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 6cb36614aa01..f74ef9ff55ea 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 @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/PrivateLinkResourcesList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 983a5e7c69a7..36a09891d96a 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ResolvePrivateLinkServiceId.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 f20fdd714e1a..475727b4e625 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/RunCommandRequest.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 a931d3087c0b..cf8daca742b8 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/RunCommandResultFailed.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 28f8ac7cd705..03a41a1b451e 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/RunCommandResultSucceed.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 8a1e280a04f3..af86c8ca61a7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/SnapshotsCreate.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 6d17a37e34be..78b24fc8f11e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py @@ -36,6 +36,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/SnapshotsDelete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 060b9d7c3f69..1e61c4e0c196 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/SnapshotsGet.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 ac4f5429cbdd..74ef151f95f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/SnapshotsList.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 c9e94860f8c7..43e961537bd9 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/SnapshotsListByResourceGroup.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 7126bb590d57..fa737b606881 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/SnapshotsUpdateTags.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 281c661e7c04..76520c335b79 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 @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 dee2e0abb51d..22050380f522 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 @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/TrustedAccessRoleBindings_Delete.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 f218d803c4a1..c0259975161e 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/TrustedAccessRoleBindings_Get.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 967bfee8ed3b..c83709a07b32 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 @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/TrustedAccessRoleBindings_List.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/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 717ffe9700c2..f5c8b11ffe5e 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 @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/TrustedAccessRoles_List.json +# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-04-02-preview/examples/TrustedAccessRoles_List.json if __name__ == "__main__": main()